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§
- Allocation
State - 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.
- Turn
Allocation - A live TURN allocation: a bound relay socket plus the policy attached to it.
- Turn
Server - TURN server: allocation table plus the accept loop.
Enums§
- Peer
Scope - Which peer addresses this relay may be pointed at.