Tether Documentation
Contents

Tether 0.6.3 · architecture

How Tether works

Tether is a self-hosted remote desktop for Windows and macOS with Linux relays. It is built on a lightly patched RustDesk core (1.5.3) inside Tauri 2 apps. All a client needs is TLS WebSockets on port 443 to its relays; without a proxy in the way, direct LAN, P2P and UDP-relay paths are raced beside them. Every session is end-to-end encrypted. Policies, release indexes, server key lists and branded customer apps are signed on the administrator's PC, so a compromised relay can push neither settings nor code, and cannot read sessions by watching the traffic. A relay node also holds the server key that vouches for device keys: with it, whoever controls the ID server could impersonate a host (docs/encryption.md).

443 onlyAll a client needs: TCP 443 out, port 80 fallback, no listening ports. Without a proxy, LAN, P2P and UDP relay paths race beside it.
3 keysServer key (pinned, rotatable by signed list), admin key (policies, release index, API), updater key (release files).
~0.9 sPicture back after a relay restart (median of 3 production runs, 0.4.0).
0 / 30Sessions dropped during Kubernetes rolling updates of hbbr and hbbs.
57 / 73 msDelay to first appearance on a GPU-less host, direct / relay (0.6.2); AnyDesk 9.8.3 through its relay: 67–68 ms.

Components

ComponentWhereRole
Technician app “Tether”apps/desktopTauri 2 + React. One binary is both viewer and host (main window, session windows, file transfer, connection manager, optional background service: Windows service, or on macOS a LaunchDaemon and LaunchAgent since 0.6.3). NSIS installer per machine; macOS universal .dmg.
TetherQSapps/quickPortable customer module, one TetherQS.exe (macOS: portable .app). Same core, minimal UI, incoming sessions only (conn-type=incoming, disable-installation=Y). Host server and connection manager run in one normal-user process; config in %APPDATA%\Tether-QS.
Tether Manageapps/manageAdmin app (Windows). Holds the admin and updater keys and server keys made for a rotation (sealed with a passphrase); signs policies, release indexes and files, server key lists, team rosters and custom-app profiles; runs staged rollouts, release clean-up, the optional download CDN, devices, diagnostics tickets and the session audit log; talks to every relay with signed requests.
tether-trustcrates/tether-trustShared Rust crate: signed envelopes, policy bundle and resolution, admin request signatures, version ordering, release index, server key list, team roster, custom-app profiles and trailer.
hbbsrelay nodeRustDesk rendezvous server (1.1.16), patched so hosts register over WebSocket, with least-loaded relay choice and backup relays, health endpoints, drain, WebRTC signalling, STUN and TURN on UDP 21116, and release hints to hosts.
hbbrrelay nodeRelay: pairs the two halves of a session by uuid and forwards ciphertext. Drains on stop.
Caddyrelay nodeTLS front end on 443 (Let's Encrypt, TLS-ALPN-01). Port 80 answers with a redirect to HTTPS, or carries TLS as the fallback route where it is forwarded to 443 (production). Routes WebSockets, API, release indexes and static downloads. nginx is an alternative (PROXY=nginx).
tether-apiserver/apitiny_http service (MemoryMax=64M, up to 32 requests at once). Serves signed policy and server key list, heartbeats, the session audit log, team endpoints, diagnostics uploads, release files and indexes, the download page and custom-app links from flat files; Prometheus metrics. No database.
DuckDNStether-ddns.timerFree permanent names that follow the nodes' IPs (refresh every 5 min and at boot). Clients are built against names, never IPs.
Relay hostsHetzner, OCIPrimary: Hetzner Cloud CX23 (AlmaLinux 9). Backup: an Oracle Always Free VM.Standard.E2.1.Micro (1/8 OCPU, 1 GB, Oracle Linux 9). Same server key pair on both.
Component diagram: technician app, relay node and TetherQS, each with UI, Rust shell and core; Tether Manage talks to the relay API. end-to-end encrypted session (X25519 + XSalsa20-Poly1305, or DTLS on WebRTC), via hbbr or direct Technician PCWindows / macOS · Tether app Tether UI · ReactSession · Settings · Diagnostics Tauri 2 shell · Rustcommands · policy · netpolicyupdate · recording · diag · cli RustDesk core (patched)capture · codecs · inputrendezvous · WebRTC · E2E crypto Relay nodeLinux VM · systemd (or Kubernetes) Caddy :443 (:80 → 443)/ws/id · /ws/relay · /api · /download hbbsrendezvousWS :21118 hbbrrelayWS :21119 tether-apipolicy, devices:21120 /downloadreleases, pagestatic files health :21121 / :21122 · STUN/TURN udp :21116 Customer PCTetherQS · no install, no admin TetherQS UI · ReactID · password · Accept card Tauri 2 shell · Rustpolicy · netpolicy · updatecustom-app profile · elevate RustDesk core (same)incoming only · in-processhost server + conn. manager Admin PC Tether Manageadmin key · updater key (sealed) signed admin API (Tether-Sig)
All three apps share the tether-trust crate. Clients connect out to Caddy over wss:// on 443; Caddy fans out to hbbs, hbbr, tether-api and the static download folder. A session runs through hbbr unless a direct path (LAN, WebRTC/ICE, or TURN on hbbs) wins the race; the relay only ever sees ciphertext of the session.

Repository layout and build

apps/desktop/            technician app (src/ = React UI, src-tauri/ = Rust shell, e2e/ = benches and tests)
apps/quick/              TetherQS (portable, Tauri bundling off on Windows)
apps/manage/             Tether Manage
crates/tether-trust/     envelope, policy, reqauth, version, release, serverkeys, team, custom (shared types and crypto)
crates/webrtc-sctp/      the WebRTC stack's SCTP with faster loss detection (patched into apps and core)
patches/                 rustdesk.patch, hbb_common.patch, rustdesk-server.patch, rustdesk-server-hbb_common.patch
scripts/                 bootstrap.sh, build-macos.sh, build-relay.sh, test-relay.sh, make-patches.sh,
                         sign-windows.ps1, deploy-relay-update.sh, release-checks.sh
server/                  Dockerfile(.static), docker-compose.yml, systemd units, caddy/, nginx/, install.sh,
                         rotate-key.sh, api/, patched/turn, cloudflare/ (download CDN worker)
deploy/                  helm/tether-relay (Helm chart), kind/ (test cluster and harness), monitoring/
tools/                   bench/ (meters, corporate proxy, network audit), macbuild/ (Mac build runner),
                         turn-bench/, load/, vm/
docs/                    specs and runbooks (this site: docs/site/)

Patched RustDesk core

scripts/bootstrap.sh fetches RustDesk 1.5.3, hbb_common and rustdesk-server 1.1.16 into vendor/ at pinned tags, checks the pinned commits and applies patches/*.patch (pin, taken upstream changes and the review of upstream pull requests: docs/upstream.md). Tether's changes sit behind the tauri cargo feature: the Tauri bridge src/tauri_ui (video passthrough, connection manager events), no insecure fallback, recording consent, 443-only networking and route racing in hbb_common::websocket, LAN-only WebRTC behind a proxy, codec choice on low-memory hosts, exact still pictures, macOS input and launchd fixes, and the fluxrt log lines. The relay patch adds WebSocket host registration, health endpoints, drain, least-loaded and backup relay choice, WebRTC signalling, STUN and TURN. scripts/make-patches.sh regenerates the patches.

Build

TargetHow
Windows prerequisitesRust (MSVC), Node 22+, LLVM (LIBCLANG_PATH), VS Build Tools, vcpkg (VCPKG_ROOT, triplet x64-windows-static)
Technician appnpx tauri build --bundles nsis → Tether_<v>_x64-setup.exe
TetherQScargo build --release --features custom-protocol (or npx tauri build) → TetherQS.exe, the only artifact
macOSbash scripts/build-macos.sh: installs Rust targets, NASM 2.16.03, pinned vcpkg under .tools/; builds universal Tether_<v>_universal.dmg, .app.tar.gz and TetherQS-<v>-universal.zip into dist/macos/ (ad-hoc signed unless APPLE_SIGNING_IDENTITY is set). macOS 11+. Releases are built on a build Mac through signed jobs from the PC (tools/macbuild, docs/mac-build-runner.md).
Code signingSelf-signed Tether Code Signing certificates, not notarized: Windows files signed with scripts/sign-windows.ps1, every Mac release by the build job; trust installers in certs/ (docs/code-signing.md)
Relayscripts/build-relay.sh in WSL: static musl hbbs, hbbr, tether-api (needs server/patched/turn); image from server/Dockerfile.static (distroless, about 8 MB)

Since 0.6.0 Tether, TetherQS and Tether Manage carry one version number and are bumped and built together. Release builds refuse to compile without TETHER_SERVER (comma-separated list allowed), TETHER_PUB_KEY, TETHER_ADMIN_PUB_KEY and TETHER_UPDATER_PUB_KEY. For development, npm run dev serves the UI against an in-browser mock backend, and TETHER_PROFILE=b starts a second instance with its own config, so host and viewer can run on one PC.

Deployment

Deployment: technician PC, admin PC and a customer network behind a TLS-inspecting proxy connect to two independent relay nodes, a Hetzner primary and an Oracle backup; DuckDNS keeps their names current. Technician PCTether app (viewer and host)races requests over both relays Admin PCTether Managepublishes to every relay Customer network TetherQS (host)registers with every relay Proxy · TLS inspectiononly 443 allowed out Two providers, no shared state Relay 1: Hetzner Cloud CX23, AlmaLinux 9 · Relay 2: Oracle Always Free E2.1.Micro, 1 GB RAM, Oracle Linux 9 Relay 1 · relay.example.com · primary Caddy hbbs hbbr tether-api server key pair · drain 300 s Relay 2 · relay2.example.com · backup Caddy hbbs hbbr tether-api same key pair · drain 300 s DuckDNSname → IPevery 5 minand at boot wss :443 (80) hbbs on each node checks every hbbr's /readyz every 3 s: least-loaded healthy primary, the backup only when none is healthy viewer: WebSocket to every hbbs, then one hbbr host: registers with every hbbs via the proxy signed admin API
Production: two independent nodes that share no state except the server key pair. Availability comes from the clients, which register with and race across all nodes, and from each hbbs being able to hand out any node's relay. Since 2026-11-06 a Hetzner node is the primary and an Oracle free-tier node the backup (the Oracle route delivered only 4–7 Mbit/s); the first Oracle node was retired.
ItemRelay 1 (primary)Relay 2 (backup)
Namerelay.example.comrelay2.example.com
HostHetzner Cloud CX23, AlmaLinux 9, SELinux enforcing, nightly updates and reboot (the backup takes the sessions meanwhile)Oracle Always Free VM.Standard.E2.1.Micro, Oracle Linux 9; kdump off and crashkernel removed (it reserved 448 MB of the 1 GB), 2 GB swap file
Servicestether-hbbs, tether-hbbr, tether-https (Caddy), tether-api, tether-ddns.timer; unprivileged users, systemd sandboxing (ProtectSystem=strict, ProtectHome, NoNewPrivileges, PrivateTmp)
Data/var/lib/tether (key pair id_ed25519 and peer DB; back it up), /var/lib/tether-api (policy, server key list, devices, audit log, team, releases, tickets, custom apps)
Relay list (RELAY_SERVERS, same order on both hbbs)relay.example.com|https://relay.example.com/readyz/relay,relay2.example.com|https://relay2.example.com/readyz/relay|backup; a node may check its own hbbr at http://127.0.0.1:21121/readyz

A complete node is set up by server/install.sh <name> (hbbs, hbbr, Caddy or nginx, tether-api, firewall ports 443, 80, 21115–21117/tcp and 21116/udp, DuckDNS), or with Docker (server/docker-compose.yml, host networking, uid 65532). install.sh only opens port 80; the TLS fallback route on 80 is a firewalld forward to 443 added by hand on the production relays. Updates roll out relay by relay with scripts/deploy-relay-update.sh, backup first. Prometheus, alert rules and Grafana dashboards: docs/monitoring.md.

Network

443-only

The one connection type a client needs is WebSocket over TLS on TCP 443 to the relay names; registration, signalling, the API and the relay all use it. The apps force the core options allow-websocket=Y, disable-udp=Y and api-server=https://<relay>; upstream's UDP and IPv6 hole punching and LAN discovery stay off (netpolicy.rs, FLOOR). Behind a proxy (detected or configured) nothing else goes to the internet. Hosts keep one WebSocket open permanently, with an empty-frame heartbeat every 20 s so proxies do not close it.

Upstream hbbs accepts host registration only over UDP. The patched hbbs accepts RegisterPeer/RegisterPk over TCP/WebSocket with the same uuid, key, IP-change and rate-limit checks, keeps that connection as the host's signalling path, and gives every proxied client a unique address (forwarded IP plus connection port).

Direct paths beside the relay

With policy network.direct = auto (default) the viewer races direct paths against the relay; off means relay only. The session window shows which path won.

PathBadgeHowNeeds
Same LANDirect (LAN)UDP broadcast lookup for the host's ID (port 21119), then TCP to the host's listener (21118); also WebRTC between two private addresseshost listener allowed by its firewall (Windows installer rule, local subnet only)
IPv6, both globalDirect (IPv6)WebRTC/ICE host candidatesno proxy on either side
NAT hole punchingP2PWebRTC/ICE server-reflexive candidates; STUN only on hbbs UDP 21116 of Tether's own relays, never public STUN serversno proxy, outbound UDP
UDP relayRelay (UDP)TURN embedded in hbbs on the same UDP 21116, 5-minute REST credential per offer, no relaying to private ranges, per-IP and bandwidth capsno proxy, outbound UDP to the relay
RelayRelayhbbr over WSS on 443 (below)always available

The WebRTC offer, answer and ICE candidates travel inside the TLS WebSocket to hbbs. A ready relay waits at most 0.4 s for a direct attempt (0.8 s more when the host offered a TURN candidate), so a network that drops UDP costs at most that. Behind a proxy, WebRTC runs LAN-only: no STUN or TURN server, only private addresses, public candidates dropped, so nothing bypasses the proxy towards the internet. Every path runs the same end-to-end handshake, password, Accept and permission checks; WebRTC is protected by DTLS bound to the host's signed identity (Encryption). Under packet loss the UDP paths keep latency near the path delay where TCP stalls (docs/stun-turn.md).

Route racing

To its own relays, Tether tries up to four routes, Happy-Eyeballs style: wss://relay on 443 and on 80, each through the detected proxy and directly. They start 300 ms apart; the first completed TLS + WebSocket handshake wins and the rest are dropped. The winner is cached per relay host and tried first next time, for /ws/id and /ws/relay. Because direct routes run alongside proxy routes, a dead proxy setting cannot keep Tether offline. Port 80 is TLS too where firewalld forwards it to Caddy's 443 listener (same certificate, same endpoints; set up by hand on the production relays, not by install.sh). The API, heartbeats, policy and update checks use the same racer.

Scenario (2026-11-03)AnyDeskTether
Zscaler-style TLS inspection, 443 onlyfails (needs an inspection exemption)works, 62.8 ms glass-to-glass, 27.9 fps
Port 80 only, inspection onfails without an exemptionworks, 56–59 ms, 28 fps
Proxy configured but deadnot testedworks (direct route wins)
Recovery after a 90 s total block> 100 s2.7 s after reopening (worst case ≤ 18 s)

Proxy detection and TLS inspection

Proxy order: HTTPS_PROXY / ALL_PROXY, then the system proxy (Windows: WinINet settings, PAC files, WPAD via WinHTTP, and for the background service the machine WinHTTP proxy; macOS: scutil --proxy). Detection repeats every 60 s, so VPN and network changes are picked up. HTTP CONNECT, HTTPS and SOCKS5 proxies are supported.

The relay certificate is verified by rustls. If a proxy re-signs TLS with a company CA, Tether falls back to the OS TLS stack, which trusts the CA deployed to the machine. There is never an “accept any certificate” fallback. An inspecting proxy can see the relay name, timing and sizes, and the rendezvous signalling (device ID, public key, connect requests). It cannot see the session: in the Zscaler-style test the proxy saw 1,454 relay frames whose byte statistics look like random data (printable-byte ratio 0.37).

Relay ports and routes

Path / portTargetNotes
/ws/idhbbs WebSocket 127.0.0.1:21118registration and signalling
/ws/relayhbbr WebSocket 127.0.0.1:21119relayed session bytes
/api/*tether-api 127.0.0.1:21120policy, server key list, heartbeat, audit, team, diagnostics, admin API
/q/*tether-apicustom-app downloads (see Custom apps); the prepared file is sent by Caddy (X-Accel-Redirect)
/download/<channel>/releases(-v2).jsontether-apisigned release indexes, ETag / 304
/download/*Caddy file_serverrelease files; latest.json served with Cache-Control: no-cache
/download/index.htmldownload page, else 200 Tether relay
/readyz/relayhbbr :21121/readyzhealth of this node's relay for other nodes
/rendezvous/pubkeyhbbs :21122/pubkeythe server key hbbs signs with (key rotation check)
TCP 80forwarded to 443 (production) or redirectfallback route
UDP 21116hbbsSTUN and TURN for the direct paths; also rendezvous for stock RustDesk clients
21118 / 21119hbbs / hbbr WebSocketbound to 127.0.0.1 (WS_BIND), reached only through Caddy
21121 / 21122hbbr / hbbs healthbound to all interfaces; install.sh does not open them in the firewall
21123 / 21124 / 21125hbbs / hbbr / Caddy metricsPrometheus, 127.0.0.1 only

Stock RustDesk clients would also need TCP 21115–21117 and UDP 21116; Tether clients need only 443 and use UDP 21116 when it is reachable.

Session flow

The relay path below always works and is the only one behind a proxy. The viewer asks every hbbs in parallel, the hbbs that knows the host picks a relay, and both sides meet on that hbbr. Only then do the two devices run the end-to-end handshake, through the relay. Without a proxy the same request also carries a WebRTC offer, and the direct paths race this flow; the first path that completes the handshake carries the session.

Sequence diagram of a session: registration, relay request, relay pairing, end-to-end key exchange, login and streaming. Viewertechnician app hbbsrendezvous, any node hbbrrelay chosen by hbbs HostTetherQS or Tether 1 · Registration (always on, with every hbbs) RegisterPeer / RegisterPk over wss://relay/ws/id RegisterPkResponse · kept open as signalling path 2 · Relay request (raced across all hbbs; next one after 1 s or on failure) PunchHoleRequest (force_relay, offer) picks least-loaded healthy hbbr(/readyz every 3 s, ties rotate) PunchHole { relay_server } dial /ws/relay (uuid) RelayResponse → same hbbs RelayResponse + signed host key dial /ws/relay (uuid) pairs both halves by uuidforwards bytes only 3 · End-to-end handshake (through hbbr) SignedId: host's Ed25519 identity, checked against the key the server signed PublicKey: X25519 box key + session key sealed for the host from here on XSalsa20-Poly1305, one key per direction · no key ⇒ connection refused, never plaintext 4 · Login and session Hash { salt, challenge } LoginRequest (salted password hash) — or the host user clicks Accept LoginResponse + PeerInfo (displays; recording permission off) VideoFrame stream (AV1 / H.264 / HEVC …), up to 60 fps mouse, keyboard, clipboard, files, key-frame requests delay test once a second · 3 s of silence ⇒ reconnect
The “TCP punch attempt” in logs is only the label of the PunchHoleRequest; hbbs answers with a relay because the request carries force_relay. A host whose relay leg fails retries its dial 4× at 0.3 s; the viewer gives up on a pairing after 5 s (RELAY_PAIR_TIMEOUT) and asks again.

File transfer from a session. Each login of the technician app carries a random 128-bit companion_secret (inside the encrypted connection only). The file-transfer window opened from a session reuses that session's session key (peer ID, name, 64-bit session ID) and secret. The host admits such a connection without a new accept or password only while an authorized remote connection with the same key and secret is open and its Transfer files permission is on (constant-time compare). The session key alone is not secret (audit posts carry it); without the secret the customer is asked as for any connection.

Reconnect

StepBehaviour
Detect a dead relayTCP close, or 3 s without the host's once-a-second delay test (RELAY_SILENCE_LIMIT)
Retriesat once, then 0.25, 0.5, 1, 2, 4, 8, 10 s (lib/reconnect.ts) for connect.reconnect-minutes (10)
“Failed to connect via relay” while it restartstreated as transient; the series goes on
Host answer to a relay requestWebSocket to hbbs and relay dial at the same time
Picturedecoder and canvas kept; the first key frame of the new stream resumes it
Passwordkept in the session, no prompt; the resume ticket (session key + companion_secret) skips password and Accept, never 2FA, while the old connection runs and for 120 s after it dropped
Host loses its hbbs registrationat once, then 0.2 … 16 s backoff; WebSocket ping every second, 3 s silence = dead
Never retriedwrong password, rejected or closed by the other side, policy and version errors

Measured with apps/desktop/e2e/reconnect-bench.mjs (0.4.0, 2026-11-03): production systemctl restart tether-hbbr → 0.93, 0.90, 0.90 s from overlay to the first new frame (0.3.0: 2.27 s and 17.8 s, one run gave up). Session's server stopped for good (local): 0.34 s, re-paired through the other server. Both hbbs killed: the running session was never interrupted.

Video pipeline (FluxRT)

FluxRT is a clean-room low-latency profile on the RustDesk core: written from public descriptions and black-box measurements only, not wire-compatible with any other product.

Video pipeline from host capture to viewer canvas. Capturechanged framesonly Encodehardware firstAV1 sw if no GPU Encryptsecretbox / DTLS(end-to-end) Pathhbbr on 443,TURN or direct Decryptviewer coreno re-encode Passthroughper-windowbinary channel WebCodecshw decode→ canvas host network viewer
PropertyMechanism
Hardware encodeH.264 → HEVC → AV1 hardware encoders (NVENC, AMF, QSV, VideoToolbox), zero-copy D3D11 texture → NVENC (vram). Low-latency presets: no B-frames, no lookahead, 1-frame VBV.
GPU-less hostsAV1 (aom) stays the automatic choice on hosts with ≤ 4 GB RAM (upstream fell back to VP8, about 3 fps on screen content); software encoders use up to 4 cores.
Viewer decodeEncoded frames go untouched to the webview (tauri_ui::video_passthrough), are decoded by WebCodecs in hardware (optimizeForLatency) and drawn on a desynchronised canvas at the full coded size. One window cannot read another session's frames.
Key-frame recoveryKeyRecovery in src/lib/video.ts: request a key frame at once and again every second until one arrives; resync only when the decoder is more than 24 frames behind (MAX_DECODE_QUEUE). This replaced a “queue > 3” rule that caused refresh storms.
Exact still pictures (0.6.2)Full-width strips of 8 rows that stood still for 1.5 s are sent as the host's own pixels (RGB, left-delta, zstd, hashed) between video frames, at the video bitrate; the viewer keeps them over later frames while the host lists them as unchanged. Text and photos settle bit-exact. Both ends 0.6.2+; not on hosts with a GPU texture encoder, not in recordings (exact_still.rs, docs/performance.md).
Viewer watchdogFrames fed but none drawn for 10 frames over 3 s: switch that codec to native decoding; still nothing after 5 s: ask the host for VP9 (video.ts watchdog).
Rate control60 fps ceiling sent explicitly; QoS LAN fast path; upstream video_qos lowers fps first, then bitrate.
Local cursor, inputRemote cursor shape becomes the local CSS cursor; pointer moves coalesced per animation frame, clicks and keys sent at once.
IdleUnchanged frames are not encoded.
RecordingPassthrough frames go to TauriHandler::record_passthrough; the viewer requests a key frame when recording starts. WebM/MP4, no re-encoding.

Security model

The relay operator is not trusted with content: the relay forwards ciphertext. Trust is anchored in public keys compiled into the clients; private keys live on the relay (server key) or only on the admin's PC (admin and updater keys). Threat model with actors and residual risks: SECURITY.md; known weaknesses W1–W18: docs/encryption.md.

Keys

KeyPrivate halfPublic halfProtects
Server key (Ed25519)/var/lib/tether/id_ed25519 on every relay node (same pair)compiled in: TETHER_PUB_KEY, replaced by the admin-signed server key list (GET /api/server-keys) once a device has oneSigns device public keys, which is how a viewer knows a host's key (whoever holds it and controls hbbs can impersonate hosts). hbbs -k _ / hbbr -k _ also reject clients that do not present the matching public key, or one in KEYS_ACCEPT during a rotation (a configuration check, not authentication). Rotated without reinstalling clients: docs/key-rotation.md.
Admin key (Ed25519)Tether Manage, keys.jsoncompiled in: TETHER_ADMIN_PUB_KEY; relay: ADMIN_PUB_KEYPolicies, signed release indexes, server key lists, team rosters, custom-app profiles, every admin API request. Several keys may be trusted for rotation.
Updater key (minisign)Tether Manage, keys.jsoncompiled in: TETHER_UPDATER_PUB_KEYInstallers, update archives, TetherQS.exe and the macOS zip; the signed trusted comment names file and version
Team member key (Ed25519)each technician appteam roster, published by Tether ManageTeam requests (/api/team/*: shared tags, devices, audit) without the admin key
Device identity (Ed25519)each device's configregistered with hbbs, signed by the server keyPeer authentication in the E2E handshake

Admin and updater keys are sealed with argon2id (64 MiB, 3 passes) + XChaCha20-Poly1305 under the admin's passphrase (≥ 8 characters, no recovery). Losing them means rebuilding every client, since new admin and updater keys only work in newly built clients; the server key, by contrast, can be rotated through the signed list.

Encryption

LayerMechanism
TransportTLS 1.2/1.3 WebSocket on 443 (rustls with bundled and OS roots, then the OS TLS stack, so inspection CAs work; never unverified). The rendezvous channel relies on this TLS alone.
Peer ↔ peerEd25519 host identities signed by the server key; host-signed ephemeral X25519 key; random session key sealed with crypto_box, split into one key per direction; XSalsa20-Poly1305 (libsodium secretbox) on relay and LAN, DTLS bound to the host's signed fingerprint on WebRTC. Forward secrecy. Full description and limits: docs/encryption.md.
No plaintext fallbackViewer: refuses instead of asking “continue insecurely” (client.rs::confirm_insecure_connection). Host: aborts when the peer offers no key, sends no key exchange, the transport is not flagged secure or its own key pair is missing (server.rs::identity_handshake).
Secrets at restPermanent password (stored as a salted SHA-256, password-equivalent), 2FA secret and remembered peer passwords wrapped with a key made from the machine uid: obfuscation, not protection against someone who can read the config. The device's Ed25519 key is stored unencrypted (0600 on macOS).
AuthenticationAccept click and/or password; 10-character one-time password; permanent password ≥ 12 characters, ≥ 3 classes; optional TOTP 2FA; failures counted per IP and per IPv6 /64, /56, /48, throttled, then blocked, and the one-time password rotates

Signed policies and requests

Security floor and hardening

tether_trust::policy::FLOOR lists core options no policy can set; the apps force them on top of any policy: allow-insecure-tls-fallback, allow-remote-config-modification, enable-check-update, allow-auto-update, direct-server, enable-remote-printer, allow-auto-record-incoming/outgoing, stop-service, enable-camera, enable-terminal, allow-websocket, disable-udp, enable-lan-discovery, api-server, enable-webrtc, enable-udp-punch, enable-ipv6-punch, custom-rendezvous-server, relay-server, key.

  1. Every incoming connection on a Tether host starts with its recording permission off, regardless of settings; the viewer's recorder is gated off before the first frame (record_state && record_permission).
  2. Record sends Misc.client_record_status = true as a request; no frame is recorded yet.
  3. The host's connection manager emits record_consent_request {conn_id, peer_name, text}; the user answers via cm_record_consent {connId, allow}.
  4. Allow turns the permission on and the viewer starts recording (REC pill); Deny sends it off again. The host can revoke at any time; a reconnect is a new connection and asks again.

recording.mode=always only automates the request. An unattended host never answers, so it is never recorded. A modified viewer could still capture frames it receives; consent is enforced by Tether's own viewer.

Policy model

A policy is one signed tether_trust::policy::Bundle: a serial, one layer per profile (technician, customer), named groups with overrides and device assignments by install uuid. 47 features in areas permissions, security, connections, video, recording, updates, policy, interface, diagnostics and customer (full table: docs/policy.md, generated from FEATURES).

Policy layers from built-in defaults to machine policy, later wins; the result is the effective policy with the security floor applied on top. later wins Machine policy (GPO / MDM)HKLM\SOFTWARE\Policies\Tether PolicyJson · macOS Managed Preferences Group overridesdevices assigned by install uuid · groups target one profile Profile: technician | customerfrom the signed Bundle Custom app (branded TetherQS download)signed CustomProfile layer · customer features only Built-in defaultstether_trust::policy::FEATURES Effective policyvalue + lock per featuresources: defaults, profile, custom-app,group:<name>, machinelocked core options → overrides Security floor (FLOOR)TLS verification · E2E · 443-onlyno silent recording · relay and keyforced on top, never settable States per layer default: not set here · on: user may change, value is the default · off: locked off · locked: locked to value · hidden: locked off, not shown A later layer set to “on” unlocks a feature an earlier layer locked (not a custom app over the profile). An invalid or unknown rule is skipped; the other rules of its layer apply.
policy::resolve_with(bundle, profile, device, custom, machine). The custom app sits between profile and group: it is the admin's choice for everyone using that download, while groups and GPO/MDM still target individual devices. Its setting is ignored for a feature the profile locks: its signed settings have no serial or expiry and cannot be revoked on a downloaded app, so they never switch on what the published policy locks.

Distribution. Clients poll GET /api/policy every policy.refresh-minutes (15; 1 with policy.fast-apply) with If-None-Match: "<serial>", verify, reject lower serials, cache the verified document and apply it at the next start before the core runs. Then they send POST /api/heartbeat (uuid, ID, profile, version, OS, policy and server key list serials, update state; ≤ 2048 bytes, rate-limited). The server key list (GET /api/server-keys) is fetched before every policy check. The policy API and heartbeats use the first server that answers; update checks ask every relay for the release index.

Publishing from Tether Manage. Publishing validates the draft (unknown features or values make it unpublishable), shows a review of the change, signs it, and publishes the same signed document to every configured relay with serial = highest serial on any relay or published from this PC + 1. It then reads back each relay's state and reports per relay; a relay that missed it can be published to again, since any node with a lower serial accepts the same document. History keeps the last 50 versions per relay (policy-history/<serial>.json); restore republishes old content under a new serial, and only documents that verify with this PC's admin key are used.

Updates

Update flow: build and sign, Tether Manage signs files and the release index, uploads to every relay and the optional CDN, clients are hinted or poll, verify, follow the rollout, then install the technician app or self-update TetherQS. Build4 release variablesPC · Mac build runner Tether Managefiles: updater keyindex: admin key Every relay (+ CDN)1 files · 2 releases.json(+ v2) · 3 latest.json Client checkshbbs hint, heartbeat answer,start, every 6 h, policy change Verify and decideindex serial · sha256 · minisignrollout bucket · halt · policy Modes Optional: card “Install and restart” / “Later” Mandatory: sessions blocked until installed Minimum version: blocked below it (release or policy) Forced: countdown update.restart-seconds (60 s) Blocking in the backend via update-state.json: outgoing refused (CLI exit 6), incoming closed, TetherQS disables Accept Technician appstaged download · NSIS passiveservice stop/start · restart TetherQS (portable).new → rename running → .oldrestart, same ID + password
Upload order guarantees that an index never points to a missing file: files to every relay and the CDN, then the signed releases.json and releases-v2.json, then each relay's latest.json (read only by clients up to 0.5.23). One signed index is valid on every relay (https://{relay} stands for the relay it came from), so an update never depends on another node.

High availability

Any number of independent nodes, each the full stack. No cluster protocol, no shared database; they share only the server key pair.

  1. Hosts register with every node (TETHER_SERVER list plus policy servers.list, up to 8 entries: host names or wss://host/path, verified with the same server key). One independent registration loop per server.
  2. Viewers race their request: the last server that worked first, the next one on failure or after 1 s without an answer. The first hbbs that knows the host wins.
  3. Relay choice (server side): every hbbs has a relay list of <address>[|<health URL>][|backup] entries and fetches each health URL every 3 s (2.5 s timeout). hbbr's /readyz answers 200 ready sessions=N or 503 draining sessions=N. hbbs hands out the least-loaded healthy primary; ties rotate. Backups are used only while no primary is healthy (failover in about 3–6 s, back on the first passed check; running sessions stay). Locality does not matter.
  4. The host sends its RelayResponse to the same hbbs, which forwards it to the viewer; both meet on the chosen hbbr.

Drain

On SIGTERM hbbr reports not-ready at once and keeps relaying open sessions. For the first 5 s it still pairs new uuids (an hbbs may hand it out until its next check), then refuses new pairings. It exits when the last session ends or after DRAIN_TIMEOUT (systemd 300 s, Kubernetes 3600 s); a second signal exits at once. hbbs is not-ready for its own DRAIN_TIMEOUT (default 0). Health: hbbr :21121, hbbs :21122, /healthz and /readyz.

Failures and measured failover

EventEffectMeasured
Session's hbbr crashes (production, viewer behind the proxy)Session re-pairs on another relay0.6–0.8 s
Whole relay node down (production)Session continues through the other relay0.6–1.6 s
Primary hbbr killed and kept down (production, Hetzner + Oracle backup)Backup used for new sessions; running session came back over the backupfailover logged after 4 s; session back after 22 s; new session first frame 1.0 s
hbbs or node diesHosts stay registered elsewhere; relayed sessions do not use hbbs and continueno interruption
Dead relay leaves every hbbs's healthy setA pick that lands on it before fails fast and the client asks againwithin 3 s + 2.5 s
Caddy restartWebSockets through it are cut; clients reconnectkind: 20–40 ms
DuckDNS / IP changeName follows within 5 min; clients use the other node meanwhile–

Tether Manage with N nodes: it writes to every node (policy, server key list, team roster, release files and indexes, download page, custom apps) and the nodes stay independent. A node that missed a write is stale, not wrong. Diagnostics tickets are created on the first node and opened with the same ID on the others; device lists are merged by uuid, newest last_seen wins. Capacity estimate (not measured): an E2.1.Micro has up to 480 Mbit/s and a 10 TB/month allowance; at 1–5 Mbit/s per session one node is bandwidth-bound at a few dozen concurrent sessions. Sizing for 10 000 devices and 3 000 sessions, with measurements: docs/scaling.md.

Kubernetes

Helm chart deploy/helm/tether-relay: the same design with every pod acting as a node. hbbr only pairs two halves that reach the same process, and a host's RelayResponse must reach the hbbs that holds the viewer, so load balancing either would break sessions. Every pod therefore gets a stable URL.

Kubernetes topology: clients through a load balancer to two Caddy proxies, which map path ordinals to per-pod services for hbbs and hbbr, plus tether-api. Clientswss://relay… LB / ingressTLS · cert-manager proxy ×2 Caddy Caddy namespace tether hbbs-0Service + pod · peer DB PVC hbbs-1Service + pod · peer DB PVC -r … /readyz every 3 s ↓ hbbr-0Service · publishNotReady hbbr-1Service · publishNotReady hbbr-n≥ 2, drain 3600 s tether-api+ Caddy sidecar :8081PVC 5Gi (optional) Path mapping /ws/id/<n> → hbbs-<n> /ws/id → hbbs-0 /ws/relay/<n> → hbbr-<n> /api, /download, / → api regex: scaling never restarts it Every hbbs gets <publicUrl>/ws/relay/<i> |http://…hbbr-<i>:21121 /readyz, for every i hands out full wss:// URLs clients use them as-is PDBmaxUnavailable 1non-root, read-only FS
StatefulSets give stable ordinals; each ordinal has its own Service with publishNotReadyAddresses: true, so a draining pod stays reachable for its open sessions and half-made pairs.

Measured on kind

2026-11-03 (0.4.0): kind v0.33.0 (Kubernetes 1.37), 1 control plane + 2 workers; hbbs ×2, hbbr ×3 (drain 90 s), proxy ×2, api ×1. The harness does what clients do (register with both hbbs, race, re-pair after a drop or 1 s of silence; 1 KiB frames every 20 ms).

TestSessionsReconnectsMax gap
hbbr rollout restart (57 s) during churn3000
hbbs rollout restart (7 s) during churn3000
proxy rollout, live sessions6340 ms
force-delete hbbr-16239 ms
delete hbbr-2, grace 15 s6220 ms
worker frozen, proxies elsewhere651.02 s
worker frozen with a proxy pod on it6443.7 s

Relay latency in the cluster: p50 0.3 ms. The last row is the known weak spot: kube-proxy keeps routing to a proxy pod on a silently dead node until it is NotReady (~40 s). Behind a cloud LoadBalancer use externalTrafficPolicy: Local with health checks of a few seconds and keep proxies on different nodes.

Custom apps

A custom app is a branded TetherQS: a signed tether_trust::custom::CustomProfile plus a private, expiring download link.

Layout of a custom Windows TetherQS file: plain exe, signed profile JSON, 4-byte length and the 8-byte magic TQSPROF1. TetherQS-<v>.exe (plain)unchanged code; signed exe: trailer inside its certificate table signed CustomProfileenvelope JSON, ≤ 256 KiB lenu32 LE magicTQSPROF1 custom::attach(), by tether-api on GET /q/<token> missing, damaged or untrusted trailer ⇒ plain TetherQS
FieldRule
id[a-z0-9-]{1,40}, random, the same on every relay
name1–64 printable characters; window title (overrides customer.title) and file name <Name>-Support.exe (reduced to [A-Za-z0-9 _.-])
accent, welcome#rrggbb; ≤ 400 characters (override customer.accent-color, customer.welcome)
logo_pngbase64 PNG, ≤ 96 KiB decoded
layerpolicy layer, customer-profile features only, same value rules as the bundle
issued_atUnix seconds
  1. Tether Manage signs the profile with the admin key and calls PUT /api/admin/custom/<id> on every relay with {profile, token, expires, channel} (≤ 300 KiB). Token: 32 random bytes, base64url, 43 characters; expiry in the future and ≤ 366 days.
  2. The relay verifies the signature against its admin keys, validates the profile, requires profile.id == <id>, and stores custom/<id>.json (0600). A new token for the same id kills the old link.
  3. GET /q/<token> (public) returns the channel's current TetherQS-<v>.exe with the profile attached (custom::attach: appended, or for an Authenticode-signed exe placed at the end of its certificate table so the signature stays valid). A Mac browser gets the macOS zip; /q/<token>/windows and /mac force a platform. Unknown, revoked and expired tokens all get the same 404 (no oracle); 30 requests/min per IP; downloads are counted.
  4. TetherQS reads its own file, verifies the profile against the compiled-in admin keys and applies it as the custom-app policy layer. Self-updates verify the new plain exe, then attach the profile again.

macOS (0.5.25+): the signed .app cannot carry a trailer, so the relay only renames the bundle folder inside the zip to <Name>-Support [<mac id>].app (the folder name is not sealed, the code signature stays valid). At first start TetherQS reads the mac id from its folder name, fetches the signed profile from GET /q/m/<mac id>, verifies it like the trailer and caches it. DELETE /api/admin/custom/<id> revokes a link at once. The relay never modifies the profile.

Diagnostics

Relay API

EndpointAuthPurpose
GET /api/policypublicSigned policy, ETag: "<serial>", 304 when unchanged
GET /api/server-keyspublicAdmin-signed server key list, ETag / 304
POST /api/heartbeatpublicDevice report; 1 per uuid per 60 s; 30 per IP per minute for uuids the relay does not know yet; ≤ 50 000 devices, 180 days. Answers {"releases": G} (release generation)
POST /api/audit/conn|file|alarmpublicSession audit records from hosts (≤ 8 KiB, rate-limited, unauthenticated)
POST /api/diag/<ticket>ticketDiagnostics zip ≤ 2 MiB
GET /download/<channel>/releases(-v2).jsonpublicSigned release index, ETag: "<serial>"
GET /q/<token>[/windows|/mac], GET /q/m/<mac id>tokenCustom TetherQS download; signed profile for a macOS custom app
/api/team/me|devices|tags|auditmember-signedTeam access with a technician's own key from the roster: shared tags (If-Match revision), devices, audit (members with audit)
PUT /api/admin/policysignedPublish (≤ 256 KiB, validated strictly, serial must increase); history of 50
GET /api/admin/policy-history[/<serial>]signedList / fetch published documents
PUT /api/admin/server-keyssignedServer key list (≤ 16 KiB, serial must increase)
GET /api/admin/devicessignedDevice list
GET /api/admin/auditsignedSession audit records, newest first, ≤ about 8 MiB per answer
POST /api/admin/diag-ticket, GET /api/admin/diag[/<t>], POST …/diag/<t>/close, DELETE …/diag/<t>signedTickets (optional fixed ID for multi-relay), archive, delete
PUT|DELETE /api/admin/release/<channel>/<path>, GET /api/admin/releasessignedRelease files ≤ 200 MiB and indexes, atomic writes; published files refused without ?force=1; 507 below 2 GiB free
POST /api/admin/releases/prunesignedRelease clean-up: plan or delete old versions
PUT /api/admin/download-pagesignedDownload page HTML ≤ 512 KiB
PUT|DELETE /api/admin/custom/<id>, GET /api/admin/customsignedCustom apps
PUT|GET /api/admin/teamsignedTeam roster (≤ 500 members)
GET /api/admin/statussignedVersion, free disk, devices, policy and key list serials, release generation and indexes, uptime, last clean-up

Without ADMIN_PUB_KEY the admin endpoints answer 503; without RELAY_HOST every v2-signed request answers 401. Every JSON write is temp file + rename; upload bodies are streamed to disk. Full wire contract: docs/api.md.

Performance

Current numbers (0.6.x, GPU-less 1080p VM host)

Delay to the first appearance of each new picture while scrolling, split with the host's capture timestamps (docs/performance.md, 2026-11-11/12):

Part (median)Relay (WebSocket)Direct (LAN)
page drew it → host has it captured56 ms54 ms
→ handed to the viewer's decoder17 ms3 ms
delay to first appearance73 ms57 ms

AnyDesk 9.8.3 through its relay: 67–68 ms on the same meter. Tether's own part before the network is about 6 ms; the rest is the VM drawing and composing in software. Still page against AnyDesk (0.6.0): luma 39.2 vs 35.2 dB and text 43.4 vs 34.7 dB in Tether's favour, chroma and photo in AnyDesk's; from 0.6.2 a settled still page is the host's screen bit for bit (exact still pictures). A 2.3 s blackout on the TCP relay route gives a 4.3 s picture gap (TCP's retry timer); the UDP paths do not have this. The tables below are historical.

Window drag on a GPU-less VM (0.4.0)

Hyper-V VM, 4 vCPU, 8 GB, no GPU, 1920×1080, TetherQS host with software AV1; viewer on a PC with an RTX 3080; both through the production relay.

BuildRemote frames/sLongest gap between picturesLatency p95
0.3.0 as reported (refresh storm)3–41.6 s or frozen1.2 s
0.4.020 / 2390 ms88 / 55 ms
0.4.0, VM egress only via TLS-inspecting proxy20.1 / 22.999 / 79 ms66 / 59 ms

Against AnyDesk (0.4.0; black-box, same VM, same optical meter)

ViewerLatency meanp95Frames/sLongest freeze
AnyDesk 9.8.362.4 ms95 ms11.2509 ms
Tether 0.4.0 (inspection exempt, like AnyDesk)72.2 ms98 ms12.6507 ms
Tether 0.4.0 (TLS-inspected)74.3 ms102 ms14.7563 ms

On par: same p95 and worst gap, slightly more pictures, AnyDesk about 10 ms lower on average. Optical freeze figures are conservative (motion blurs the barcode); the canvas meter shows Tether's picture never paused more than about 99 ms. In the earlier idle/scrolling comparison on the same VM (0.1, P2P over the Hyper-V switch), Tether averaged 37.9 ms vs 52.1 ms glass-to-glass (27 % lower), p95 59 vs 83 ms, 28.1 vs 19.7 fps.

With a GPU (2026-11-03)

Single PC, RTX 3080, 2560×1440: glass-to-glass mean 24.0 ms (scrolling, Speed) to 30.2 ms (idle, Balanced), 57 fps at full resolution, WebCodecs decode 0.7 ms per frame, HEVC via NVENC zero-copy, about 2.3 Mbit/s for a mostly static desktop. Input: median 12 ms, p95 19 ms over 40 pointer moves. Through a Zscaler-style proxy: 62.8 ms mean, 27.9 fps.

Known limits