[Live-devel] HLS Proxy - HTTP Connection Events?

Ross Finlayson finlayson at live555.com
Sun Jun 12 22:12:59 PDT 2022



> On Jun 12, 2022, at 7:06 PM, <phonglv at lovad.vn> <phonglv at lovad.vn> wrote:
> 
> HLS Proxy almost fully meets the above requirements, but I encountered a case that I did not know how to solve as follows:
> - When HTTP (web browser) clients connect to My HLS Server, I want to catch this event to start using RTSP Client to connect to back-end RTSP Server
> - Conversely, when HTTP (web browser) clients disconnect from My HLS Server, I want to catch this event to disconnect RTSP back-end
> - Due to the large number of RTSP Streams in the system, only when there are really HTTP Clients connecting to the HLS, I have to request to the back-end RTSP Server.

We don’t allow for any way to do this, because the "LIVE555 HLS Proxy” knows only about the HLS files (including the “.m3u8” playlist) that it writes.  It doesn’t know or care about whatever might be reading these files.  Note that these files might be stored (replicated) on a distributed file system or other CDN system, in which case there might be several different web servers (spread throughout the world) reading these files.  Or there might not be any web server(s) at all - e.g., your web browser - running on the local host - could read the stream using a “file://“ URL.

So note that web browsers never ‘connect to’ or ‘disconnect from’ the "LIVE555 HLS Proxy”; web browsers know only about web servers, or perhaps about local files.  And even web *servers* know nothing about the "LIVE555 HLS Proxy”; they merely read the files that the "LIVE555 HLS Proxy” generates.

If you want your client(s) to have some control over whether/when a back-end RTSP stream runs, then you should make them *RTSP* clients rather than HTTP browsers, and perhaps use the “LIVE555 (RTSP) Proxy Server”: http://live555.com/proxyServer/


Ross Finlayson
Live Networks, Inc.
http://www.live555.com/




More information about the live-devel mailing list