Starts an RTMP server.
Add it to your supervision tree:
children = [
{RTMP.Listener, port: 1935, handler: MyApp.RTMPHandler}
]Options
:handler(required) — a module implementingRTMP.Handler.:handler_options— passed toRTMP.Handler.init/2for every connection. Default[].:port— TCP port. Default1935. Use0for a random free port (seeport/1).:acceptors— number of acceptor processes. Default10.:max_connections— concurrent connections before new ones are refused. Default16_384.:limits— per-connection limits, a keyword list orRTMP.Limitsstruct. SeeRTMP.Limitsfor options and defaults.:transport_options— passed to:gen_tcpvia ThousandIsland, e.g.[ip: {127, 0, 0, 1}]to bind to localhost only.:name— registered name for the listener's supervisor.
Each connection runs in its own process; a failure in one never affects the listener or any other connection.
Summary
Functions
The port the listener is bound to — useful after starting with port: 0.
Starts the listener. See the module docs for options.
Stops the listener, waiting up to timeout ms for connections to finish.
Open connections get RTMP.Handler.handle_disconnect/2 with :shutdown.
Functions
@spec port(Supervisor.supervisor()) :: {:ok, :inet.port_number()} | :error
The port the listener is bound to — useful after starting with port: 0.
@spec start_link(keyword()) :: Supervisor.on_start()
Starts the listener. See the module docs for options.
@spec stop(Supervisor.supervisor(), timeout()) :: :ok
Stops the listener, waiting up to timeout ms for connections to finish.
Open connections get RTMP.Handler.handle_disconnect/2 with :shutdown.