WebSocket Protocol

Clients connect to the relay using a standard WebSocket URL:

ws://<host>:<port>/ws?device_id=<uuid>&token=<pair-token>

Noise XX Handshake (3 messages)

After the WebSocket connection is established, the Noise Protocol XX handshake begins immediately:

StepDirectionContent
1Client → ServerEphemeral public key
2Server → ClientEncrypted server static key + ephemeral
3Client → ServerEncrypted client static key

After the 3-message handshake, an E2EE tunnel is established. All subsequent frames are opaque encrypted binary, the relay never inspects them.

Message Forwarding

After the handshake, the relay:

  1. Identifies the destination device by its pairing relationship
  2. Forwards encrypted frames without inspection
  3. Buffers messages briefly if the peer is temporarily disconnected

CLI Reference

CommandDescription
relayly startStart relay + admin servers
relayly start --config path/to/relayly.yamlUse custom config
relayly pair <name>Register device, print QR code
relayly pair <name> --no-qrPrint token only
relayly link <id1> <id2>Pair two devices for relaying
relayly statusShow connected devices + uptime
relayly status --format=jsonMachine-readable output