Vhost: Cluster redirect to different vhost or stream #3654
Replies: 2 comments
-
Vhost AliasThis is the Alias feature of vhost, which means alias. When playing different vhosts, they actually point to the same vhost. This can achieve separate scheduling of upstream and downstream vhosts, as well as risk isolation. Stream AliasAnother type is stream alias, which is an alias for the stream and can be used for hot backup. For example, there are two streams:
If the stream is an alias of streamA,
The actual stream being played is streamA. You can use reload to implement There is a workaround, using FFmpeg to pull streamA out and push it as stream, which is ffmpeg -f flv rtmp://xxx/app/streamA -c copy -f flv rtmp://xxx/app/stream Please read more about the detail from this post |
Beta Was this translation helpful? Give feedback.
-
Description'
Please ensure that the markdown structure is maintained.
I am trying to use srs cluster mode to redirect srs-edge to different srs-origins with different vhosts.
For example:
Step One:
client play rtmp -> srs-edge.test.vhost (remote mode) -> srs-balancer.test.vhost (local mode) -> local coworker (this is my application that responds to an API cluster request)
Step Two:
local coworker (my application) Send api answer with Origin: {IP,PORT, vhost=pub1-vhost}-> srs-balancer Send RTMP Redirect with RTMP://IP:PORT/stream?vhost=srs-edge.test.vhost (it ignores vhost=pub1-vhost) -> srs-edge.test.vhost (remote mode) go to rtmp redirect
Unfortunately, srs only uses the Host and Port from the api cluster response, but Vhost is still required for my cluster scheme.
3.0.140
srs-edge.test.vhost Log
srs-balancer Log:
My app send:
response={"code":0,"data":{"query":{"ip":"srs-edge.test.vhost","vhost":"srs-edge.test.vhost","app":"test","stream":"test"},"origin":{"ip":"10.0.0.2","port":20135,"vhost":"srs-pub1.test.vhost","api":"srs-pub1.test.vhost:20185","routers":["srs-pub1.test.vhost:20185"]}}}
But RTMP Redirect:
rurl=rtmp://10.0.0.2:20135/test/test?vhost=srs-edge.test.vhost
srs-edge.test.vhost
srs-balancer.
Replay
How to replay bug?
ffplay rtmp://srs-edge.test.vhost:20135/test/test
tail -f /var/log/srs/srs.log
tail -f /var/log/srs/srs-balancer.log
Expect
Please describe your expectation
Is it possible to teach SRS to use Vhost Param from API clusters answer to redirect RTMP?
Thanks.
TRANS_BY_GPT3
Beta Was this translation helpful? Give feedback.
All reactions