Expand description
NAT traversal helpers (STUN, hole punching, TURN integration).
This module provides:
- STUN binding discovery for public addresses
- UDP hole punching between peers
- TURN relay allocation helpers (via
turnmodule)
Structs§
Enums§
Functions§
- allocate_
turn_ relay - attempt_
hole_ punch - Attempt UDP hole punching with a peer and return the first successful socket.
- detect_
nat_ type - Compare local and public address lists to detect NAT behavior.
- gather_
local_ candidates - Collect local (host) candidates for a given listen port. Loopback, unspecified, and link-local addresses are excluded.
- gather_
public_ addrs - Query STUN servers to discover public-facing addresses.
- gather_
turn_ candidates - Allocate TURN relays and return candidates if successful.
- parse_
turn_ server - Parse a TURN server URI into a config struct.
- spawn_
keepalive - Spawn periodic keep-alive packets to keep NAT bindings warm.
- spawn_
turn_ keepalive - Periodically send empty datagrams to keep the TURN allocation alive.