MongooseICE v0.4.0 MongooseICE.UDP View Source
UDP STUN server
The easiest way to start a server is to spawn it under MongooseICE’s supervision tree providing the following configuration:
config :mongooseice, :servers,
udp: [ip: {192,168, 1, 21}, port: 32323]
…or hook it up to your supervision tree:
children = [
MongooseICE.UDP.child_spec([port: 3478]),
MongooseICE.UDP.child_spec([port: 1234]),
...
]
You can also start a server under MongooseICE’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.
Link to this section Summary
Functions
Returns child specification of UDP server which can be hooked up into supervision tree
Starts UDP STUN server under MongooseICE’s supervisor
Starts UDP STUN server with given options
Stops UDP server started with start/1
Link to this section Types
option :: {:ip, MongooseICE.ip} | {:port, MongooseICE.portn} | {:relay_ip, MongooseICE.ip} | {:realm, String.t}
Link to this section 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 MongooseICE’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