Protocol
Voice nodes accept control and media packets over UDP.
Control packets (JSON)
- Auth:
{"type":"auth","channelId":"...","userId":"...","secret":"..."}
- Ping:
{"type":"ping"}
Media packets (binary, recommended)
UVN packet format v1:
- Header (24 bytes):
magic(3 bytes):UVNversion(1 byte):1packetType(1 byte):1for audioflags(1 byte, reserved)channelIdLen(u16 BE)userIdLen(u16 BE)payloadLen(u16 BE)sequence(u32 BE)timestampMs(u64 BE)
- Body:
channelId(utf8)userId(uuid string)payload(Opus frame bytes)
Hardening behavior
- Rate limit per sender socket (
VOICE_NODE_MAX_PACKETS_PER_SECOND) - Payload size hard cap (
VOICE_NODE_MAX_AUDIO_PAYLOAD_BYTES) - Sequence replay guard (
sequencemust be newer) - Session ownership check (socket + user + channel)
Legacy
Legacy JSON audio packets are accepted for migration:
{"type":"audio","channelId":"...","userId":"...","payload":"<base64>"}.