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:
| Step | Direction | Content |
|---|---|---|
| 1 | Client → Server | Ephemeral public key |
| 2 | Server → Client | Encrypted server static key + ephemeral |
| 3 | Client → Server | Encrypted 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:
- Identifies the destination device by its pairing relationship
- Forwards encrypted frames without inspection
- Buffers messages briefly if the peer is temporarily disconnected
CLI Reference
| Command | Description |
|---|---|
relayly start | Start relay + admin servers |
relayly start --config path/to/relayly.yaml | Use custom config |
relayly pair <name> | Register device, print QR code |
relayly pair <name> --no-qr | Print token only |
relayly link <id1> <id2> | Pair two devices for relaying |
relayly status | Show connected devices + uptime |
relayly status --format=json | Machine-readable output |