TsgcTURNServer › Properties › TURNOptions
TURNOptions Property
TURN-specific options: default Allocation lifetime, port range, Relay IP and long-term credentials.
Syntax
property TURNOptions: TsgcTURNServer_Options read FTURNOptions write SetTURNOptions;
Default Value
—
Remarks
Groups the options that govern how the TURN server allocates relay endpoints and authenticates its clients:
- Fingerprint and Software: add FINGERPRINT and SOFTWARE attributes to outgoing TURN messages, independently of the STUN-level flags in STUNOptions.
- Allocation.DefaultLifeTime: seconds applied to a new Allocation when the client omits the LIFETIME attribute (RFC 5766 recommends 600 s).
- Allocation.MaxLifeTime: upper bound for any requested lifetime; higher values are clamped to this ceiling on the ALLOCATE response.
- Allocation.MaxUserAllocations: maximum number of concurrent Allocations granted to the same authenticated user.
- Allocation.MinPort / MaxPort: range of UDP ports reserved for the relay sockets assigned to Allocations.
- Allocation.RelayIP: optional override for the XOR-RELAYED-ADDRESS value reported to the client — useful when the server is behind a 1:1 NAT or advertises a different public address.
- Authentication: TURN authentication. Long-term credentials are mandatory per RFC 5766; enable
LongTermCredentials, set Realm and StaleNonce, and provide the per-user password from the OnSTUNRequestAuthorization handler.
Example
oTURN.TURNOptions.Allocation.DefaultLifeTime := 600;
oTURN.TURNOptions.Allocation.MaxLifeTime := 3600;
oTURN.TURNOptions.Allocation.MinPort := 49152;
oTURN.TURNOptions.Allocation.MaxPort := 65535;
oTURN.TURNOptions.Authentication.Enabled := True;
oTURN.TURNOptions.Authentication.LongTermCredentials.Enabled := True;
oTURN.TURNOptions.Authentication.LongTermCredentials.Realm := 'esegece.com';
oTURN.Active := True;
Back to Properties