System overview
Crosslink connects two devices through an end-to-end encrypted channel. The system has three layers:Component diagram
How a connection is established
Phase 1: Pairing
Phase 2: Session establishment
Phase 3: RPC communication
Transport layer
The client tries every endpoint the pairing QR advertised, in the order the host listed them (LAN and WAN-direct addresses first, then signaling/relay/tunnel routes). If awebrtc upgrade is configured, the client additionally attempts to upgrade an already-connected session to a direct WebRTC DataChannel, falling back to the existing transport if that fails.
LAN transport
- Direct WebSocket between devices
- No external services needed
- Lowest latency
- Works only on same network (or when the host advertises a
wanaddress reachable via a router port mapping)
WebRTC transport
- Peer-to-peer data channel, negotiated as an upgrade after an initial connection is established
- NAT traversal via STUN/TURN
- The relay connection remains as a fallback if the upgrade fails
Relay transport
- All traffic routed through the relay service
- Highest latency
- Works whenever a relay is configured and reachable
- Server sees only ciphertext