Skip to content

Configuration Reference

This document explains every option available in turn-server.toml. All keys are written in TOML syntax.


KeyTypeDefaultValuesDescription
server.realmstring"localhost"Realm announced to TURN/STUN clients. See RFC 5766 §3 for the formal definition.
server.port-rangestring ("start..end")49152..65535Example: "49152..65535"Inclusive range of relay ports the server is allowed to allocate. Keep the range inside the dynamic port interval (49152–65535) unless you fully control the host.
server.max-threadsintegernumber of logical CPUsUpper bound for worker threads used by the async runtime.
server.interfaces.transportstring enum (required)"udp" or "tcp"The transport protocol exposed on this interface. This table can be declared multiple times; every entry describes one listening endpoint.
server.interfaces.listenstring ("IP:PORT")Local socket address to bind. Use a specific NIC address when the machine is multi-homed; 0.0.0.0:3478 binds to all IPv4 interfaces.
server.interfaces.externalstring ("IP:PORT")Publicly reachable address advertised to clients. Set this to the NAT/public IP when the bound address is not directly reachable.
server.interfaces.idle-timeoutinteger (seconds)20Maximum idle period before a transport connection is dropped.
rpc.listenstring ("IP:PORT")"127.0.0.1:3000"Bind address for the management HTTP server. It serves gRPC and, when built with the prometheus feature, GET /metrics.
rpc.timeoutinteger (seconds)5Global timeout applied to API handlers.
rpc.ssl.private-keypath to PEM filePrivate key file for TLS on the API endpoint.
rpc.ssl.certificate-chainpath to PEM fileCertificate chain file for TLS on the API endpoint.
hooks.endpointstring (URL)Base URL of the external hook service used for dynamic auth and event callbacks.
hooks.timeoutinteger (seconds)5Global timeout applied to API handlers.
hooks.max-channel-sizeinteger1024Upper bound for buffered hook events.
hooks.ssl.private-keypath to PEM filePrivate key file for TLS when communicating with the hook service.
hooks.ssl.certificate-chainpath to PEM fileCertificate chain file for TLS when communicating with the hook service.
log.levelstring enum"info"error,warn,info,debugControls verbosity of the built-in logger.
log.stdoutbooleantrueEnable or disable logging to standard output (stdout). If set to true, log messages will be printed to the console in addition to (or instead of) file logging. To disable logging to the console, set this option to false.
log.file.directorystring (optional)If specified, log output will be written to this directory in a file named turn-server-YYYY-MM-DD.log. If not set, file logging is disabled.
log.vector.endpointstring ("IP:PORT")Optional Vector TCP endpoint. Logs are sent as newline-delimited JSON (message, level, target, file). Use a Vector socket source with mode = "tcp" and decoding.codec = "json". The server connects at startup.
auth.enable-hooks-authbooleanfalseEnable or disable hook-based dynamic authentication.
auth.static-auth-secretstring (optional)Shared secret for TURN REST authentication. When provided, the server skips secret lookups through the hook API.
auth.static-credentialstable of username = "password"Static user database used before falling back to hook authentication. Populate this map with long-term accounts that should always exist.

NOTE

Optional TLS configuration applies to rpc.ssl.* (gRPC and /metrics) and hooks.ssl.* entries. Certificates are loaded via rustls with the AWS-LC backend.

Security note

the management gRPC endpoint ships without authentication or TLS. Enable the SSL settings above or terminate TLS behind a proxy before exposing it to untrusted networks.

All settings are hot-reloaded on restart. Keep secrets (private keys, shared tokens) protected with standard filesystem permissions.

Released under the MIT License.