Closed ysc3839 closed 5 months ago
As outlined in URL, the following formats should be used for the vhost. It is important to note that these formats are applicable to RTMP, HTTP-FLV, and HLS.
http://demo.srs.com:8080/live/livestream.flv
http://192.168.1.100/live/livestream.flv?vhost=demo.srs.com
Some CDNs also support the subsequent format, which helps to prevent query strings containing special characters.
http://192.168.1.100/demo.srs.com/live/livestream.flv
SRS is expected to be compatible with the previously mentioned format; however, there seems to be a problem with the last one, leading to an incorrect vhost in the HTTP callback.
As described in the URL, the following format should be used as vhost. It is important to note that these formats are applicable for RTMP, HTTP-FLV, and HLS.
http://demo.srs.com:8080/live/livestream.flv
http://192.168.1.100/live/livestream.flv?vhost=demo.srs.com
Some CDNs also support the following format, which helps to avoid including special characters.
http://192.168.1.100/demo.srs.com/live/livestream.flv
SRS needs to be compatible with the above format; however, the last format seems to have a bug that causes the vhost in the HTTP callback to be incorrect.
TRANS_BY_GPT3
I checked versions 5.0 and 6.0, and it seems that this issue is not present. However, I don't have enough time to check version 4.0. Could you try upgrading to the latest version and see if the issue still persists?
This issues is fixed in SRS 5.0+. Because SRS 4.0 is not maintained, upgrading to 5.0 or 6.0 is a better solution.
Description
When playing an http-flv stream with vhost, the value of the
app
parameter in theon_play
hook is[vhost]/[app]
instead of[app]
. This behavior is inconsistent with the old version (2.x).Modify the code. https://github.com/ossrs/srs/blob/2573a25101514f0e3d152b96cd33b31bd00e136d/trunk/src/app/srs_app_http_stream.cpp#L708-L711
Log output.
The temporary solution is to add
nreq->app = req->app;
but unsure if there are any other issues.The documentation seems to have an issue. The example given on this page is
http://192.168.1.100/live/livestream.flv?vhost=demo.srs.com&token=xxx
, but it actually returns a 404 error.Replay
Step 1: Push the RTMP stream to
rtmp://127.0.0.1/live/livestream?vhost=vlive
. Step 2: Playhttp://127.0.0.1/vlive/live/livestream.flv
. Step 3: Theapp
parameter in theon_play
hook isvlive/live
.Expect
The
app
parameter should belive
.TRANS_BY_GPT3