You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The presence of the trailing slash makes the path absolute. This causes errors if there is any redirect to a different path.
EXAMPLE: viewer access content through a reverse proxy or CDN that performs URL rewrite from a publicly available path to an internal address and path where srs is available, e.g.
When a viewer requests the content, what happens is
Player performs GET http://my-public-server/srs/live/livestream.m3u8
Reverse proxy matches the request and remaps to GET http://srs-origin/live/livestream.m3u8
SRS receives request GET http://srs-origin/live/livestream.m3u8 and returns master playlist.
Player receives the multi-variant "master" playlist containing path of media playlist as /live/livestream.m3u8?hls_ctx=g518h58s path
Player now compose hostname+absolute path and performs GET http://my-public-server/live/livestream.m3u8?hls_ctx=g518h58s
Reverse proxy receives a request that does not match the rewrite rules. It returns 404 and SRS never receives a request. This happens because the "srs" part has been dropped.
The correct request would have been GET http://my-public-server/**srs**/live/livestream.m3u8?hls_ctx=g518h58s. The player did the right thing and followed the rules, the problem is that the path in the master playlist is absolute (/live/livestream.m3u8?hls_ctx=g518h58s instead of live/livestream.m3u8?hls_ctx=g518h58s1).
I have read the docs and noticed hls_entry_prefix but I'm not sure this is useful in this case.
Version
Version 5 from ossrs/srs:5
To Reproduce
Steps to reproduce the behavior:
Run srs docker and stream some content
Use NGINX or other reverse proxy and perform path rewrite from public address to internal srs address involving dropping a path (e.g. remap external address 'http://public-srs-origin/path' to 'http://private-srs-origin"
Try and play HLS (player included in srs docker image or HLS.js)
Observe master playlist is downloaded correctly but playback fails as media playlist cannot be downloaded
Expected behavior
The master playlist should not use absolute path. I would expect a playlist like this
Describe the bug
When looking at a multi-variant or "master" playlist, path to the media playlist are absolute. I.e.
The presence of the trailing slash makes the path absolute. This causes errors if there is any redirect to a different path.
EXAMPLE: viewer access content through a reverse proxy or CDN that performs URL rewrite from a publicly available path to an internal address and path where srs is available, e.g.
http://my-public-server/srs ---> http://srs-origin
When a viewer requests the content, what happens is
GET http://my-public-server/srs/live/livestream.m3u8
GET http://srs-origin/live/livestream.m3u8
GET http://srs-origin/live/livestream.m3u8
and returns master playlist./live/livestream.m3u8?hls_ctx=g518h58s
pathGET http://my-public-server/live/livestream.m3u8?hls_ctx=g518h58s
The correct request would have been
GET http://my-public-server/**srs**/live/livestream.m3u8?hls_ctx=g518h58s
. The player did the right thing and followed the rules, the problem is that the path in the master playlist is absolute (/live/livestream.m3u8?hls_ctx=g518h58s
instead oflive/livestream.m3u8?hls_ctx=g518h58s1
).I have read the docs and noticed
hls_entry_prefix
but I'm not sure this is useful in this case.Version
Version 5 from ossrs/srs:5
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The master playlist should not use absolute path. I would expect a playlist like this
Additional context
Notice that media segments path in media playlist are correct, they are relative, e.g.
Thank you very much
The text was updated successfully, but these errors were encountered: