winshining/nginx-http-flv-module

Dynamic proxy pass

dcarrion87 opened this issue · 1 comments

Looking to use this for multiple source / destination.

RTMP clients would come into this server and on_connect will look up and rewrite to the "live" application.

I'd expect there to only be one "live" application and be able to dynamically proxy pass to many different backends based on the value in the original /<stream_key>.

Is this possible without setting up unique application handlers?

I'd rather not have to use notify_send_redirect and have the client needing to support this.

You'd do this in the on_publish directive:

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 and only work with nginx versions greater than 1.3.10. See also notify_relay_redirect.

In other words, you can send rtmp://ip/app/key from the on_publish handler to dynamically create a remote relay rather than a redirect.