Class TurnOptions
Settings of the STUN and TURN server in section Turn, e.g. --Turn:Enabled=true --Turn:ExternalAddress=203.0.113.5; every change takes effect after a restart, as the server binds its ports at start.
Inherited Members
Namespace: Uniform.Stun.Hosting
Assembly: Uniform.Stun.Hosting.dll
Syntax
public sealed class TurnOptions
Fields
| Edit this page View SourceSection
Configuration section.
Declaration
public const string Section = "Turn"
Field Value
| Type | Description |
|---|---|
| string |
Properties
| Edit this page View SourceAddressCheckInterval
How often the server checks its local and public addresses for changes, besides when the system reports one.
Declaration
public TimeSpan AddressCheckInterval { get; set; }
Property Value
| Type | Description |
|---|---|
| TimeSpan |
AllowedPeers
Addresses relayed to although they are not public, separated by commas, e.g. 192.168.1.0/24 to let calls reach a local network on purpose; private, loopback and link-local addresses are refused otherwise.
Declaration
public string? AllowedPeers { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
CertificatePath
PEM file of the TLS certificate chain, e.g. fullchain.pem of Let's Encrypt; renewed files are picked up without a restart.
Declaration
public string? CertificatePath { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Enabled
Whether to run the STUN and TURN server.
Declaration
public bool Enabled { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
ExternalAddress
Public IPv4 address that peers send relayed data to, the router's public address when the server is behind NAT: a fixed address; a host name, e.g. of a dynamic DNS service, resolved again every check; or stun:host:port, asking that STUN server every check. A changed address, e.g. after the router's DHCP lease, goes to new allocations.
Declaration
public string? ExternalAddress { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
KeyPath
PEM file of the TLS certificate's private key, e.g. privkey.pem.
Declaration
public string? KeyPath { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
ListenAddress
Address to listen on; 0.0.0.0 for every IPv4 interface.
Declaration
public string ListenAddress { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
MaxAllocations
Most allocations at once; each call uses one or two.
Declaration
public int MaxAllocations { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
MaxAllocationsPerUser
Most allocations at once per user.
Declaration
public int MaxAllocationsPerUser { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
MaxRelayPort
Last UDP port of relayed addresses.
Declaration
public int MaxRelayPort { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
MinRelayPort
First UDP port of relayed addresses; behind NAT, forward the whole range to the server.
Declaration
public int MinRelayPort { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
Port
Port of STUN and TURN over UDP and TCP; 3478 is the standard.
Declaration
public int Port { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
Realm
Realm of the credentials, usually the server's domain; turn when not set, or the homeserver's name when embedded.
Declaration
public string? Realm { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
RelayAddress
Address the relay sockets bind; the listen address when not set.
Declaration
public string? RelayAddress { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
SharedSecrets
Shared secrets of time-limited credentials, separated by commas, as a homeserver's Calls:TurnSharedSecret hands them out; not needed when the server runs inside the homeserver.
Declaration
public string? SharedSecrets { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Tcp
Whether to listen over TCP on the same 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 on networks that only let web traffic through; none when not set. Needs a certificate.
Declaration
public int? TlsPort { get; set; }
Property Value
| Type | Description |
|---|---|
| int? |
Users
Fixed users as name:password, separated by commas, for clients without a homeserver.
Declaration
public string? Users { get; set; }
Property Value
| Type | Description |
|---|---|
| string |