Xirsys.XTurn.Actions.Allocate (xturn v2.0.0)

Copy Markdown View Source

Pipeline action for TURN Allocate requests.

What problem this solves

A WebRTC client needs a relay address on the TURN server so media can flow when direct peer paths are blocked by NAT or firewalls. Allocate opens relay socket(s), starts an allocation worker, and returns XOR-RELAYED-ADDRESS plus lifetime to the client.

Final step in the @allocation chain, after HasRequestedTransport, NotAllocationExists, and Authenticates.

Internal

Pipeline action only; not part of the public application API. Invoked by Xirsys.XTurn.Pipeline after earlier allocation guards succeed.

RFCs

Summary

Functions

Creates relay socket(s) and an allocation worker, then registers the allocation.

Functions

process(conn)

Creates relay socket(s) and an allocation worker, then registers the allocation.

On success, returns conn with a success response (XOR-RELAYED-ADDRESS, lifetime). On failure, tears down any partial allocation and returns conn with an error response (400, 420, 440, 486, 508, or 300 Try Alternate).