Zum Hauptinhalt springen

STUN and TURN

The backend provides an endpoint that offers information about the STUN and TURN servers. STUN URIs are simply a list of usable STUN endpoints that can be used by the client. The TURN server utilizes the pre_shared_key from the configuration to generate credentials. All STUN and TURN credentials and endpoints can be found in a list under /turn.

Configuration

The sections in the configuration file are called stun and `turn.

STUN section

FieldTypeRequiredDefault valueDescription
stunlist<string>no-List of STUN server endpoints

TURN section

FieldTypeRequiredDefault valueDescription
lifetimenumberno86400Lifetime of the generated credentials in seconds
serverslist<TurnServer>no-List of TURN server configurations, see TURN server configuration below

The configuration for a TurnServer

FieldTypeRequiredDefault valueDescription
urislist<string>no-List of TURN server endpoints
pre_shared_keystringyes-The pre-shared key to generate the TURN credentials

Examples

Custom Turn Server

[turn]
# Lifetime of the generated credentials (in seconds)
lifetime = 86400

[[turn.servers]]
# URIS of this Turn Server following rfc7065
uris = [
"turn:127.0.0.1:3478?transport=udp",
"turn:127.0.0.1:3478?transport=tcp",
"turns:127.0.0.1:5349?transport=tcp"
]
# The Pre Shared Key set with --static-auth-secret=...
pre_shared_key = "opentalk2"

Custom Stun Server

[stun]
uris = ["stun:127.0.0.1:3478"]