Fennec v0.3.0 Fennec.UDP
UDP STUN server
The easiest way to start a server is to spawn it under Fennec’s supervision tree providing the following configuration:
config :fennec, :servers,
udp: [ip: {192,168, 1, 21}, port: 32323]
…or hook it up to your supervision tree:
children = [
Fennec.UDP.child_spec([port: 3478]),
Fennec.UDP.child_spec([port: 1234]),
...
]
You can also start a server under Fennec’s supervision tree
using start/1
.
Options
All methods of starting a server accept the same configuration options passed as a keyword list:
:port
- the port which server should be bound to:ip
- the address of an interface which server should listen on:relay_ip
- the address of an interface which relay should listen on:realm
- public name of the server used as context of authorization. Does not have to be same as the server’s hostname, yet in very basic configuration it may be.
You may start multiple UDP servers at a time.
Summary
Functions
Returns child specification of UDP server which can be hooked up into supervision tree
Starts UDP STUN server under Fennec’s supervisor
Starts UDP STUN server with given options
Stops UDP server started with start/1
Types
Functions
Returns child specification of UDP server which can be hooked up into supervision tree
start(server_opts) :: Supervisor.on_start_child
Starts UDP STUN server under Fennec’s supervisor
Accepts the same options as start_link/1
.
start_link(server_opts) :: Supervisor.on_start
Starts UDP STUN server with given options
Default options are:
[ip: {127, 0, 0, 1}, port: 3478, relay_ip: {127, 0, 0, 1}, realm: "localhost"]
Links the server to the calling process.
Stops UDP server started with start/1
It accepts the port number server is running on as argument