API Reference xturn v#2.0.0

Copy Markdown View Source

Modules

Internal Plug adapter shim for Maru on plug_cowboy 2.x.

Maru HTTP router for XTurn operator REST endpoints.

Operator REST routes under /allocation for allocation introspection.

Operator REST routes under /auth for credential management.

XTurn is a STUN/TURN relay server for real-time media (WebRTC, VoIP, and similar).

STUN/TURN framing accumulator for one client connection.

Pipeline action for TURN Allocate requests.

Shared pipeline gate for STUN/TURN methods that require credentials.

Pipeline action for TURN ChannelBind requests.

Pipeline action for TURN ChannelData messages.

Pipeline action for TURN Connect requests.

Pipeline action for TURN ConnectionBind requests.

Pipeline action for TURN CreatePermission requests.

Guard that validates REQUESTED-TRANSPORT on Allocate.

Guard that rejects duplicate Allocate on the same client 5-tuple.

Pipeline action for TURN Refresh requests.

Pipeline action for TURN Send indications.

IPv4/IPv6 address-family constants for TURN Allocate and Refresh.

Lock-free per-allocation relay byte counters.

GenServer owning one TURN allocation (relay, permissions, channels, TCP relay).

In-process state for one Allocate.Client GenServer.

Per-username concurrent allocation limit.

ETS index of active TURN allocations and relay ingress rows.

Dynamic supervisor for per-client TURN allocation GenServers.

ETS registries for RFC 6062 TCP relay connection ids and spliced sockets.

RFC 7635 third-party authorization access tokens.

GenServer-backed ephemeral long-term TURN credential store.

Tracks STUN/TURN nonces per client endpoint before an allocation exists.

Stateless TURN REST API credentials (coturn-compatible shared secret).

OTP supervisor for TURN authentication services.

ETS-backed store for ephemeral long-term TURN credentials.

Random identifiers and hex encoding for TURN credential challenges.

Handles STUN Binding requests (client address discovery).

Certificate reload for TURNS and DTLS listeners.

:gen_event handler that reloads TLS certificates on SIGHUP.

Installs the SIGHUP certificate reload handler at boot.

Polls configured certificate files and reloads secure listeners on change.

In-memory TURN channel binding for one peer on an allocation.

ETS-backed store of TURN channel bindings (client -> peer direction).

Outbound send handle for data and STUN replies to the TURN client.

GenServer shard that runs the STUN/TURN control pipeline.

Supervisor and dispatcher for sharded STUN/TURN control workers.

Mutable request context passed through STUN/TURN action pipelines.

Hot path for relayed TURN media (client to peer and hairpin).

UDP listener that registers bound endpoints in ListenRegistry.

Dual-homed listen helpers for NAT behavior discovery.

Socket handler that multiplexes TURN control and media on one connection.

Resolves STUN/TURN listen ports and default bind tuples.

Stable {transport, socket} lookup per bound {ip, port} endpoint.

Structured logging of raw STUN/TURN datagrams exchanged with clients.

Serialises packet log lines to a dedicated file.

Validates XOR-PEER-ADDRESS for CreatePermission and ChannelBind.

ETS-backed CREATE PERMISSION allowlist keyed by allocation 5-tuple and peer IP.

Decodes and dispatches STUN/TURN control requests.

Resolved plugin chain for one TURN allocation.

Runs the per-allocation plugin chain on relay ingress and egress.

GenServer wrapper for a passive (out-of-band) relay plugin.

DynamicSupervisor for passive plugin GenServer instances.

Attaches and detaches relay plugins when allocations start and end.

Loads relay plugins and monitors allocation lifetimes.

Supervisor for the relay plugin subsystem.

ETS-backed table mapping normalised allocation keys to plugin chains.

Gates peer and refresh operations by active relay address family.

Sharded supervisor for peer -> client relay ingress.

GenServer shard that owns relay UDP sockets and delivers peer packets to clients.

Opens relay UDP ports according to server port policy.

Short-lived holds for RFC 8656 RESERVATION-TOKEN relay ports.

Pending STUN success or error attached to %Conn{} during pipeline processing.

Root OTP supervisor for TURN listeners and the HTTP API.

Placeholder GenServer for OTP supervision compatibility.

Socket pipeline for stream transports (TCP, TLS-over-TCP).

Socket pipeline for datagram transports (UDP, DTLS).

Encodes STUN indications for peer-to-client relay traffic.

OTP supervisor for the TURN server worker tree.

Map of values with per-key expiry timers.

Allocation lifetime and refresh deadline helpers.

Five-tuple identity for a TURN allocation on this server.