JoJoBond / 3LAS

Low Latency Live Audio Streaming
GNU General Public License v2.0
90 stars 23 forks source link

Possible mountpoint #15

Closed cemkoker closed 3 years ago

cemkoker commented 3 years ago

Very interesting project, I wonder if it would be possible to have it use a single port (over one port for each stream) and like a 'mountpoint' where clients can stream from like /mount1, /mount2 etc ...

Maybe with nginx ? Any idea on how to achieve this ?

Thanks !

JoJoBond commented 3 years ago

That should be possible by using either something like nginx as a reverse proxy (https://www.nginx.com/blog/websocket-nginx/), or by setting up multiple mountpoints via the 'ws' library (https://www.npmjs.com/package/ws#multiple-servers-sharing-a-single-https-server).

cemkoker commented 3 years ago

Thanks ! I'm now trying with nginx; i have the following configuration:

   location /stream1 {
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header Host $host;

                proxy_pass http://ws-backend;

                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "upgrade";
        }

        upstream ws-backend {
                ip_hash;

                server localhost:9601;
        }
    }

Now i'm just a bit confused on where i should put '/stream1' as the source for 3LAS; i only see MIME + port option in settings; or am I totally wrong ?

JoJoBond commented 3 years ago

I forgot to mention that some changes in code are required if you want to alternate the path instead of the port. I will check that really fast.

JoJoBond commented 3 years ago

Commit c14b94b723886babf3ed3220724083ffb5c26f99 should allow you to select your format via path and/or port.

cemkoker commented 3 years ago

Fantastic it works superb now ! Thanks !