Skip to content

Protocol

Voice nodes accept control and media packets over UDP.

Control packets (JSON)

  • Auth:
    • {"type":"auth","channelId":"...","userId":"...","secret":"..."}
  • Ping:
    • {"type":"ping"}

UVN packet format v1:

  • Header (24 bytes):
    • magic (3 bytes): UVN
    • version (1 byte): 1
    • packetType (1 byte): 1 for audio
    • flags (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 (sequence must be newer)
  • Session ownership check (socket + user + channel)

Legacy

Legacy JSON audio packets are accepted for migration:

  • {"type":"audio","channelId":"...","userId":"...","payload":"<base64>"}.