Class TurnServerOptions
Settings of a TurnServer: where it listens, which relay ports and address it uses, how long allocations last, and the limits that keep it from becoming an open relay.
Inherited Members
Namespace: Uniform.Turn
Assembly: Uniform.Turn.dll
Syntax
public sealed class TurnServerOptions
Properties
| Edit this page View SourceAddressCheckInterval
How often the local addresses and ExternalAddressSource are checked for changes, besides when the system reports one.
Declaration
public TimeSpan AddressCheckInterval { get; set; }
Property Value
| Type | Description |
|---|---|
| TimeSpan |
AllowedPeers
Peer addresses relayed to even when DeniedPeers has them, e.g. the server's own local network on purpose.
Declaration
public IReadOnlyList<IpRange> AllowedPeers { get; set; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<IpRange> |
Certificate
Returns the TLS certificate with its key for each new TLS connection, so renewed certificates are picked up; null without TLS.
Declaration
public Func<X509Certificate2>? Certificate { get; set; }
Property Value
| Type | Description |
|---|---|
| Func<X509Certificate2> |
DefaultLifetime
Lifetime of an allocation when the client asks for none or less; it ends unless refreshed.
Declaration
public TimeSpan DefaultLifetime { get; set; }
Property Value
| Type | Description |
|---|---|
| TimeSpan |
DeniedPeers
Peer addresses not relayed to; by default NonPublic.
Declaration
public IReadOnlyList<IpRange> DeniedPeers { get; set; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<IpRange> |
ExternalAddress
Fixed public address peers send to, which clients learn as their relayed address: the router's public address when the server is behind NAT. When null, that of ExternalAddressSource, else the relay sockets' address, which must then not be 0.0.0.0.
Declaration
public IPAddress? ExternalAddress { get; set; }
Property Value
| Type | Description |
|---|---|
| IPAddress |
ExternalAddressSource
Returns the current public address, e.g. by resolving a dynamic DNS name or asking a STUN server, when ExternalAddress is not set; asked at start, every AddressCheckInterval, and when the computer's addresses change, so a new address of a DHCP lease is followed. Null keeps the current address.
Declaration
public Func<CancellationToken, Task<IPAddress?>>? ExternalAddressSource { get; set; }
Property Value
| Type | Description |
|---|---|
| Func<CancellationToken, Task<IPAddress>> |
ListenAddress
Address the listeners bind, e.g. 0.0.0.0 for every IPv4 interface; then UDP binds each address of the interfaces that are up at start, and relays the address the client reached, so traffic leaves the way it came on computers with several networks.
Declaration
public IPAddress ListenAddress { get; set; }
Property Value
| Type | Description |
|---|---|
| IPAddress |
MaxAllocations
Most allocations at once on the server.
Declaration
public int MaxAllocations { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
MaxAllocationsPerUser
Most allocations at once per user name; a call needs one or two.
Declaration
public int MaxAllocationsPerUser { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
MaxLifetime
Longest lifetime of an allocation per refresh.
Declaration
public TimeSpan MaxLifetime { get; set; }
Property Value
| Type | Description |
|---|---|
| TimeSpan |
MaxRelayPort
Last port of relayed addresses.
Declaration
public int MaxRelayPort { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
MinRelayPort
First port of relayed addresses; behind NAT, forward the range from MinRelayPort to MaxRelayPort over UDP.
Declaration
public int MinRelayPort { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
NonceLifetime
How long a nonce is accepted; after it, requests get 438 Stale Nonce with a new one.
Declaration
public TimeSpan NonceLifetime { get; set; }
Property Value
| Type | Description |
|---|---|
| TimeSpan |
Port
Port of STUN and TURN over UDP and TCP; 3478 is the standard. 0 picks a free port, e.g. in tests.
Declaration
public int Port { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
Realm
Realm of the long-term credentials, usually the server's domain.
Declaration
public string Realm { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
RelayAddress
Address relay sockets bind; when null, ListenAddress, or the address each client reached when that is 0.0.0.0.
Declaration
public IPAddress? RelayAddress { get; set; }
Property Value
| Type | Description |
|---|---|
| IPAddress |
Software
Software name in responses.
Declaration
public string Software { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Tcp
Whether to listen over TCP on Port too, for networks that block UDP.
Declaration
public bool Tcp { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
TlsPort
Port of TURN over TLS, e.g. 5349 or 443; null for none. Needs Certificate.
Declaration
public int? TlsPort { get; set; }
Property Value
| Type | Description |
|---|---|
| int? |