Architecture & Protocols

LinkUp is built on decentralized, peer-to-peer WebRTC data channels. Explore the core systems powering direct local handshakes, NAT traversal, and high-performance frame streaming.

LinkUp Direct-Sync Handshake (LDSH)

When devices reside on the same local network or a direct route is available, LinkUp bypasses external WebSockets entirely. The Host launches a lightweight background HTTP signaling listener on port `8081` using a native Rust TCP listener.

The Client consolidates all of its ICE candidates upfront (known as Vanilla ICE gathering). Once candidate gathering is complete, the Client automatically resolves the host's IP address on the local network using the connection passphrase and sends its WebRTC SDP offer directly to the Host via POST http://<host-ip>:8081/pair.

The Host intercepts the request, prompts the user to verify the connection pairing phrase, and upon authorization, responds directly with the WebRTC SDP answer in the HTTP body. The connection transitions to active P2P streaming in a single HTTP round-trip.

Client Host :8081 1. POST /pair (Offer SDP) 2. Response 200 (Answer SDP)

NAT Traversal & Signaling

When devices reside on different internet networks behind home routers or office firewalls, direct TCP connections are blocked. LinkUp resolves this using standard WebRTC traversal mechanisms.

First, it connects to a lightweight signaling server via WebSockets to negotiate connection metadata. During this handshake, both peers consult STUN (Session Traversal Utilities for NAT) servers to discover their public-facing IP addresses and port bindings.

If both peers are behind strict, symmetric NAT firewalls that prevent direct traversal, the connection automatically routes its streams through a secure, encrypted TURN (Traversal Using Relays around NAT) server. Data remains end-to-end encrypted (DTLS-SRTP), preventing any middle-hop interception.

Client Host STUN/TURN Direct P2P WebRTC Tunnel

The Adaptive Streaming Pipeline

To deliver low-latency remote display casting, LinkUp does not use heavy video compression servers. On Windows, GDI and DXGI graphics adapters are polled natively in Rust, capturing the screen desktop as a stream of raw frames.

Each frame is converted directly to JPEG format inside a fast Rust thread pool. The resulting compressed binary payload is streamed over WebRTC data channels using optimized flow control thresholds to prevent buffer overflows.

The Client monitors connection latency (ping round-trip times) dynamically. If the latency rises, the Client automatically transmits quality adaptation events over the input channel, instructing the Host to scale down frame quality and increase capture sleep intervals on-the-fly to ensure responsive mouse controls.

DXGI Capture Rust JPEG Pool WebRTC Channel Canvas Render