Skip to main content

Module turn

Module turn 

Source
Expand description

TURN relay server (RFC 8656)

Split of responsibilities:

  • Rust owns the transport and the relay. Every allocation binds a real UDP socket; peer traffic arriving on it is forwarded to the client as a Data indication (or a ChannelData frame when a channel is bound), and Send indications / ChannelData frames from the client are forwarded to the peer from that same socket. The data plane never calls the LLM: one model round-trip per relayed packet would be absurd, and permission policy has already been decided on the control plane.
  • The LLM owns policy. Allocate, Refresh, CreatePermission and ChannelBind each raise an event; the model (or a script/static handler) decides whether to grant, for how long, and for which peers. Nothing is granted by default: a missing or unusable answer leaves the reserved socket unused and the client with no allocation.

Modules§

actions
TURN protocol actions implementation

Structs§

AllocationState
Everything about an allocation that both the request path and the relay task need: when it dies, which peers it may talk to, and its channel bindings.
TurnAllocation
A live TURN allocation: a bound relay socket plus the policy attached to it.
TurnServer
TURN server: allocation table plus the accept loop.

Enums§

PeerScope
Which peer addresses this relay may be pointed at.