Android Question Secure and limit connections to MJPEG / CCTV Server

Discussion in 'Android Questions' started by somed3v3loper, Dec 7, 2018.

  1. somed3v3loper

    somed3v3loper Well-Known Member Licensed User

    Hi everybody ,

    To save Erel and DonManfred :D some time , I decided to start a new thread

    I am using Erel's example from this thread https://www.b4x.com/android/forum/threads/mjpeg-cctv-server.73792/

    I needed two things:

    1- Limit connections so only one device (browser ) can view cam stream .

    2- Make my connection secure for example by a password that should be typed correctly to view the stream .

    Thanks in advance
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    This one is more tricky than it might seem. Browsers can make multiple connections. You can close old connections when there is a new connection (Server_NewConnection) however you will probably encounter cases where the wrong connection is closed.

    2. This line in Client.Astream_NewData reads the http request and makes sure that the client tries to connect to the root.
    Code:
    'filter out favicon calls
    If line.Trim <> "GET / HTTP/1.1" Then
    You can change it to:
    Code:
    if line.Trim <> "GET /SecretPath HTTP/1.1" Then
    Now you will need to enter the following URL in order to connect: http://<ip>/SecretPath
     
    somed3v3loper likes this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice