Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateCredentials ¶
GenerateCredentials creates time-limited HMAC-SHA1 TURN credentials. Returns username and password suitable for WebRTC ICE server configuration.
func GeneratePassword ¶
GeneratePassword computes the HMAC-SHA1 password for a TURN username.
func ValidateCredentials ¶
ValidateCredentials checks if TURN credentials are valid and not expired.
Types ¶
type Config ¶
type Config struct {
// ListenAddr is the address to bind the TURN listener (e.g., "0.0.0.0:3478")
ListenAddr string `yaml:"listen_addr"`
// TLSListenAddr is the address for TURN over TLS/DTLS (e.g., "0.0.0.0:443")
// Uses UDP 443 — requires Caddy HTTP/3 (QUIC) to be disabled to avoid port conflict
TLSListenAddr string `yaml:"tls_listen_addr"`
// PublicIP is the public IP address of this node, advertised in TURN allocations
PublicIP string `yaml:"public_ip"`
// Realm is the TURN realm (typically the base domain)
Realm string `yaml:"realm"`
// AuthSecret is the HMAC-SHA1 shared secret for credential validation
AuthSecret string `yaml:"auth_secret"`
// RelayPortStart is the beginning of the UDP relay port range
RelayPortStart int `yaml:"relay_port_start"`
// RelayPortEnd is the end of the UDP relay port range
RelayPortEnd int `yaml:"relay_port_end"`
// Namespace this TURN instance belongs to
Namespace string `yaml:"namespace"`
}
Config holds configuration for the TURN server
Click to show internal directories.
Click to hide internal directories.