An TURN/STUN server. More...
Public Member Functions | |
int | getAllocationCount () |
Gets the number of active allocations. More... | |
int | getAllocationPortMax () |
Gets the maximum allowed port to be used when allocating sockets. More... | |
int | getAllocationPortMin () |
Gets the minimum allowed port to be used when allocating sockets. More... | |
long | getDefaultAllocateLifetime () |
Gets the default lifetime for new allocations in seconds. More... | |
long | getDefaultRefreshLifetime () |
Gets the default lifetime for refreshed allocations in seconds. More... | |
boolean | getDisableBypass () |
Gets a value indicating whether to disable the in-memory bypass of the network when communicating between two relay candidates. More... | |
String[] | getForbiddenPeerCidrs () |
Gets the list of forbidden peer CIDRs. More... | |
boolean | getForceDefaultAllocateLifetime () |
Gets whether the server should force the default lifetime for new allocations (true) or allow clients to request their own lifetime within the min/max range (false). More... | |
boolean | getForceDefaultRefreshLifetime () |
Gets whether the server should force the default lifetime for refreshed allocations (true) or allow clients to request their own lifetime within the min/max range (false). More... | |
long | getMaxAllocateLifetime () |
Gets the maximum lifetime for new allocations in seconds. More... | |
long | getMaxRefreshLifetime () |
Gets the maximum lifetime for refreshed allocations in seconds. More... | |
long | getMinAllocateLifetime () |
Gets the minimum lifetime for new allocations in seconds. More... | |
long | getMinRefreshLifetime () |
Gets the minimum lifetime for refreshed allocations in seconds. More... | |
String | getNonce () |
Gets the current nonce. More... | |
String | getRealm () |
Gets the realm used for this server. More... | |
boolean | getStaleNonceSecurity () |
Gets whether the server should enforce stale-nonce security by sending a 438 Stale Nonce in response to allocate requests with a stale or non-existent nonce. More... | |
void | setAllocationPortMax (int value) |
Sets the maximum allowed port to be used when allocating sockets. More... | |
void | setAllocationPortMin (int value) |
Sets the minimum allowed port to be used when allocating sockets. More... | |
void | setDefaultAllocateLifetime (long value) |
Sets the default lifetime for new allocations in seconds. More... | |
void | setDefaultRefreshLifetime (long value) |
Sets the default lifetime for refreshed allocations in seconds. More... | |
void | setDisableBypass (boolean value) |
Sets a value indicating whether to disable the in-memory bypass of the network when communicating between two relay candidates. More... | |
void | setForbiddenPeerCidrs (String[] value) |
Sets the list of forbidden peer CIDRs. More... | |
void | setForceDefaultAllocateLifetime (boolean value) |
Sets whether the server should force the default lifetime for new allocations (true) or allow clients to request their own lifetime within the min/max range (false). More... | |
void | setForceDefaultRefreshLifetime (boolean value) |
Sets whether the server should force the default lifetime for refreshed allocations (true) or allow clients to request their own lifetime within the min/max range (false). More... | |
void | setMaxAllocateLifetime (long value) |
Sets the maximum lifetime for new allocations in seconds. More... | |
void | setMaxRefreshLifetime (long value) |
Sets the maximum lifetime for refreshed allocations in seconds. More... | |
void | setRealm (String value) |
Sets the realm used for this server. More... | |
void | setStaleNonceSecurity (boolean value) |
Sets whether the server should enforce stale-nonce security by sending a 438 Stale Nonce in response to allocate requests with a stale or non-existent nonce. More... | |
boolean | start (fm.liveswitch.ServerAddress[] udpAddresses, fm.liveswitch.ServerAddress[] tcpAddresses, fm.liveswitch.ServerAddress[] tlsAddresses) |
Starts the server. More... | |
boolean | stop () |
Stops the server. More... | |
TurnServer (fm.liveswitch.IFunction1< fm.liveswitch.TurnAuthArgs, fm.liveswitch.TurnAuthResult > authCallback) | |
Initializes a new instance of the fm.liveswitch.TurnServer class. More... | |
Public Member Functions inherited from fm.liveswitch.StunServer | |
fm.liveswitch.IFunction1< fm.liveswitch.DatagramSocketCreateArgs, fm.liveswitch.DatagramSocket > | getCreateDatagramSocket () |
Gets the create callback to create a datagram socket. More... | |
fm.liveswitch.IFunction1< fm.liveswitch.StreamSocketCreateArgs, fm.liveswitch.StreamSocket > | getCreateStreamSocket () |
Gets the create callback to create a stream socket. More... | |
boolean | getDisableTcp () |
Gets whether to prevent the server from listening for TCP requests. More... | |
boolean | getDisableTls () |
Gets whether to prevent the server from listening for TLS requests. More... | |
boolean | getDisableUdp () |
Gets whether to prevent the server from listening for UDP requests. More... | |
fm.liveswitch.ServerAddress | getLocalTcpAddress () |
Gets the local TCP address. More... | |
fm.liveswitch.ServerAddress[] | getLocalTcpAddresses () |
Gets the local TCP addresses. More... | |
fm.liveswitch.ServerAddress | getLocalUdpAddress () |
Gets the local UDP address. More... | |
fm.liveswitch.ServerAddress[] | getLocalUdpAddresses () |
Gets the local UDP addresses. More... | |
int | getStreamSendTimeout () |
Gets timeout for asynchronous data sending over stream sockets in ms. More... | |
fm.liveswitch.ServerAddress[] | getTcpAddresses () |
Gets the TCP server addresses. More... | |
fm.liveswitch.ServerAddress[] | getTlsAddresses () |
Gets the TLS server addresses. More... | |
fm.liveswitch.ServerAddress[] | getUdpAddresses () |
Gets the UDP server addresses. More... | |
void | setCreateDatagramSocket (fm.liveswitch.IFunction1< fm.liveswitch.DatagramSocketCreateArgs, fm.liveswitch.DatagramSocket > value) |
Sets the create callback to create a datagram socket. More... | |
void | setCreateStreamSocket (fm.liveswitch.IFunction1< fm.liveswitch.StreamSocketCreateArgs, fm.liveswitch.StreamSocket > value) |
Sets the create callback to create a stream socket. More... | |
void | setDisableTcp (boolean value) |
Sets whether to prevent the server from listening for TCP requests. More... | |
void | setDisableTls (boolean value) |
Sets whether to prevent the server from listening for TLS requests. More... | |
void | setDisableUdp (boolean value) |
Sets whether to prevent the server from listening for UDP requests. More... | |
void | setStreamSendTimeout (int value) |
Sets timeout for asynchronous data sending over stream sockets in ms. More... | |
boolean | start () |
Starts the server. More... | |
boolean | start (fm.liveswitch.ServerAddress[] udpAddresses) |
Starts the server. More... | |
boolean | start (fm.liveswitch.ServerAddress[] udpAddresses, fm.liveswitch.ServerAddress[] tcpAddresses) |
Starts the server. More... | |
StunServer () | |
Public Member Functions inherited from fm.liveswitch.Dynamic | |
java.util.HashMap< String, Object > | getDynamicProperties () |
Gets all dynamic properties on this instance. More... | |
Object | getDynamicValue (String key) |
Gets a property value from the local cache. More... | |
void | setDynamicValue (String key, Object value) |
Sets a property value in the local cache. More... | |
boolean | unsetDynamicValue (String key) |
Removes a property value from the local cache. More... | |
Protected Member Functions | |
fm.liveswitch.stun.Message | createExceptionResponse (fm.liveswitch.stun.Message request, fm.liveswitch.TransportAddress remoteAddress, fm.liveswitch.stun.Error error) |
Creates an exception response. More... | |
String | getLabel () |
Gets the label. More... | |
fm.liveswitch.stun.Message | process (fm.liveswitch.stun.Message request, fm.liveswitch.DatagramSocket udpServerSocket, fm.liveswitch.StreamSocket tcpServerSocket, fm.liveswitch.ServerAddress localAddress, fm.liveswitch.TransportAddress remoteAddress) |
Processes the specified request. More... | |
boolean | processBuffer (fm.liveswitch.DataBuffer buffer, fm.liveswitch.DatagramSocket udpServerSocket, fm.liveswitch.StreamSocket tcpServerSocket, fm.liveswitch.ServerAddress localAddress, fm.liveswitch.TransportAddress remoteAddress, fm.liveswitch.IntegerHolder readLength) |
Processes the buffer. More... | |
Protected Member Functions inherited from fm.liveswitch.StunServer | |
fm.liveswitch.stun.Message | createErrorResponse (fm.liveswitch.stun.Message request, fm.liveswitch.TransportAddress remoteAddress, String errorMessage) |
Creates an error response with a ganeric Stun server error. More... | |
String | getPrefix (boolean udp, boolean secure) |
Gets a prefix. More... | |
Protected Member Functions inherited from fm.liveswitch.Dynamic | |
Dynamic () | |
Protected Member Functions inherited from fm.liveswitch.Serializable | |
boolean | getIsDirty () |
Gets a value indicating whether this instance is dirty. More... | |
Serializable () | |
Initializes a new instance of the fm.liveswitch.Serializable class. More... | |
void | setIsDirty (boolean value) |
Sets a value indicating whether this instance is dirty. More... | |
An TURN/STUN server.
fm.liveswitch.TurnServer.TurnServer | ( | fm.liveswitch.IFunction1< fm.liveswitch.TurnAuthArgs, fm.liveswitch.TurnAuthResult > | authCallback | ) |
Initializes a new instance of the fm.liveswitch.TurnServer class.
authCallback | The authentication callback. |
|
protected |
Creates an exception response.
request | The request. |
remoteAddress | The remote address. |
error | The error. |
Reimplemented from fm.liveswitch.StunServer.
int fm.liveswitch.TurnServer.getAllocationCount | ( | ) |
Gets the number of active allocations.
int fm.liveswitch.TurnServer.getAllocationPortMax | ( | ) |
Gets the maximum allowed port to be used when allocating sockets.
The default value is 65535.
int fm.liveswitch.TurnServer.getAllocationPortMin | ( | ) |
Gets the minimum allowed port to be used when allocating sockets.
The default value is 49152.
long fm.liveswitch.TurnServer.getDefaultAllocateLifetime | ( | ) |
Gets the default lifetime for new allocations in seconds.
Defaults to 600 (10 minutes).
long fm.liveswitch.TurnServer.getDefaultRefreshLifetime | ( | ) |
Gets the default lifetime for refreshed allocations in seconds.
Defaults to 600 (10 minutes).
boolean fm.liveswitch.TurnServer.getDisableBypass | ( | ) |
Gets a value indicating whether to disable the in-memory bypass of the network when communicating between two relay candidates.
String [] fm.liveswitch.TurnServer.getForbiddenPeerCidrs | ( | ) |
Gets the list of forbidden peer CIDRs.
Addresses matching this list are banned from receiving relayed data packets.
boolean fm.liveswitch.TurnServer.getForceDefaultAllocateLifetime | ( | ) |
Gets whether the server should force the default lifetime for new allocations (true) or allow clients to request their own lifetime within the min/max range (false).
Defaults to false.
boolean fm.liveswitch.TurnServer.getForceDefaultRefreshLifetime | ( | ) |
Gets whether the server should force the default lifetime for refreshed allocations (true) or allow clients to request their own lifetime within the min/max range (false).
Defaults to false.
|
protected |
Gets the label.
Reimplemented from fm.liveswitch.StunServer.
long fm.liveswitch.TurnServer.getMaxAllocateLifetime | ( | ) |
Gets the maximum lifetime for new allocations in seconds.
Defaults to 3600 (1 hour).
long fm.liveswitch.TurnServer.getMaxRefreshLifetime | ( | ) |
Gets the maximum lifetime for refreshed allocations in seconds.
Defaults to 3600 (1 hour).
long fm.liveswitch.TurnServer.getMinAllocateLifetime | ( | ) |
Gets the minimum lifetime for new allocations in seconds.
Equal to 600 (10 minutes).
long fm.liveswitch.TurnServer.getMinRefreshLifetime | ( | ) |
Gets the minimum lifetime for refreshed allocations in seconds.
Equal to 600 (10 minutes).
String fm.liveswitch.TurnServer.getNonce | ( | ) |
Gets the current nonce.
String fm.liveswitch.TurnServer.getRealm | ( | ) |
Gets the realm used for this server.
boolean fm.liveswitch.TurnServer.getStaleNonceSecurity | ( | ) |
Gets whether the server should enforce stale-nonce security by sending a 438 Stale Nonce in response to allocate requests with a stale or non-existent nonce.
|
protected |
Processes the specified request.
request | The request. |
udpServerSocket | The UDP server socket. |
tcpServerSocket | The TCP server socket. |
localAddress | The local address. |
remoteAddress | The remote address. |
Reimplemented from fm.liveswitch.StunServer.
|
protected |
Processes the buffer.
buffer | The buffer. |
udpServerSocket | The UDP server socket. |
tcpServerSocket | The TCP server socket. |
localAddress | The local address. |
remoteAddress | The remote address. |
readLength | Length of the read. |
Reimplemented from fm.liveswitch.StunServer.
void fm.liveswitch.TurnServer.setAllocationPortMax | ( | int | value | ) |
Sets the maximum allowed port to be used when allocating sockets.
The default value is 65535.
void fm.liveswitch.TurnServer.setAllocationPortMin | ( | int | value | ) |
Sets the minimum allowed port to be used when allocating sockets.
The default value is 49152.
void fm.liveswitch.TurnServer.setDefaultAllocateLifetime | ( | long | value | ) |
Sets the default lifetime for new allocations in seconds.
Defaults to 600 (10 minutes).
void fm.liveswitch.TurnServer.setDefaultRefreshLifetime | ( | long | value | ) |
Sets the default lifetime for refreshed allocations in seconds.
Defaults to 600 (10 minutes).
void fm.liveswitch.TurnServer.setDisableBypass | ( | boolean | value | ) |
Sets a value indicating whether to disable the in-memory bypass of the network when communicating between two relay candidates.
void fm.liveswitch.TurnServer.setForbiddenPeerCidrs | ( | String[] | value | ) |
Sets the list of forbidden peer CIDRs.
Addresses matching this list are banned from receiving relayed data packets.
void fm.liveswitch.TurnServer.setForceDefaultAllocateLifetime | ( | boolean | value | ) |
Sets whether the server should force the default lifetime for new allocations (true) or allow clients to request their own lifetime within the min/max range (false).
Defaults to false.
void fm.liveswitch.TurnServer.setForceDefaultRefreshLifetime | ( | boolean | value | ) |
Sets whether the server should force the default lifetime for refreshed allocations (true) or allow clients to request their own lifetime within the min/max range (false).
Defaults to false.
void fm.liveswitch.TurnServer.setMaxAllocateLifetime | ( | long | value | ) |
Sets the maximum lifetime for new allocations in seconds.
Defaults to 3600 (1 hour).
void fm.liveswitch.TurnServer.setMaxRefreshLifetime | ( | long | value | ) |
Sets the maximum lifetime for refreshed allocations in seconds.
Defaults to 3600 (1 hour).
void fm.liveswitch.TurnServer.setRealm | ( | String | value | ) |
Sets the realm used for this server.
void fm.liveswitch.TurnServer.setStaleNonceSecurity | ( | boolean | value | ) |
Sets whether the server should enforce stale-nonce security by sending a 438 Stale Nonce in response to allocate requests with a stale or non-existent nonce.
boolean fm.liveswitch.TurnServer.start | ( | fm.liveswitch.ServerAddress[] | udpAddresses, |
fm.liveswitch.ServerAddress[] | tcpAddresses, | ||
fm.liveswitch.ServerAddress[] | tlsAddresses | ||
) |
Starts the server.
udpAddresses | The UDP addresses to listen on. |
tcpAddresses | The TCP addresses to listen on. |
tlsAddresses | The TLS addresses to listen on. |
Reimplemented from fm.liveswitch.StunServer.
boolean fm.liveswitch.TurnServer.stop | ( | ) |
Stops the server.
Reimplemented from fm.liveswitch.StunServer.