srs
srs copied to clipboard
HTTP Redirect Support in HTTP Callback?
This is a feature request for the HTTP 301/302 Redirect that NGINX RTMP Module supports for on_publish. Basically I am requesting to have the on_publish follow a 301/302 redirect to a new stream name.
Stream to rtmp://[vhost]/[app]/livestream Then PHP on_publish script returns "301/302" with a location So it becomes rtmp://[vhost]/[app]/[location]
Could you please describe the use scenario?
The use case: Ability to authorize individuals stream keys that can change, while keeping a display name. I've already published a script that works with RTMP/FLV module for nginx from winshining, but I would like to use SRS. This functionality is missing, That works in the other RTMP modules as far as I can tell.
Basically as follows:
- User with "StreamKey"
- OBS Stream Server -> rtmp://[vhost]/[app]
- OBS Stream Key -> StreamKey
- Stream Becomes -> rtmp://[vhost]/[app]/StreamKey
- on_publish -> rtmp://[vhost]/[app]/StreamKey -> 301/302 -> rtmp://[vhost]/[app]/UserName
Reference to NGINX RTMP "on_play" and all the other directives such as "on_publish" support this.
If 200 -> Stream at rtmp://[vhost]/[app]/StreamKey if 301/302 -> rtmp://[vhost]/[app]/StreamKey -> rtmp://[vhost]/[app]/UserName If 403 -> Stream is denied, and will not go live.
Not a use scenario, it's a requirement description.
Besides just changing a local name, nginx-rtmp also allows you to dynamically push/forward the stream to remote servers on play with 3xx directive:
302 rtmp://1.2.3.4:1935/live/newstream will automatically "push" the stream to the new remote IP.
HTTP 3xx redirects RTMP to another stream whose name is taken from Location HTTP response header. If new stream name is started with rtmp:// then remote relay is created instead. Relays require that IP address is specified instead of domain name