When you enable peer mode in dsh-zen-remote inside DeepSeek Harness (DSH), none of your workstations need a public IP address or router port forwarding. With a single zr-net:// invite link, your desktop, laptop, and cloud servers join an end-to-end encrypted virtual network. Devices discover one another automatically and surface any session marked for Remote Access in each other's sidebar, while keeping local phone QR pairing active (and lock-screen push notifications available when served behind a trusted HTTPS origin).
If you move between two or more computers during the day, peer mode saves you from repeating client-to-host 8-digit pairings across every pair of machines. Approved members form a symmetric mesh—adding a new machine only takes joining the same network link.
Step 1: Prepare a relay gateway (Managed Console or Docker)
Peers establish direct paths whenever possible, but they still rely on a gateway to coordinate NAT hole punching and carry encrypted fallback frames when networks block direct UDP traffic. Pick whichever hosting option fits your setup:
| Option | Best fit | Setup steps |
|---|---|---|
| Managed Console | You want to spin up a virtual network right away without running a server or managing TLS certificates | Sign in at console.zen-remote.com, create a virtual network, and copy its zr-net:// invite link |
| Self-hosted Docker gateway-server | Private intranet deployments or full ownership of the relay host and data directory | Run the single container image kyomio/zen-remote-gateway:latest on a reachable Linux host |
The gateway-server source lives alongside dsh-zen-remote under the MIT license, with multi-arch Docker builds for linux/amd64 and linux/arm64. When launching the container, publish both the main TCP port and the two UDP STUN ports:
docker run -d --name zr-gateway \
--restart unless-stopped \
-p 19393:19393/tcp \
-p 19393:19393/udp \
-p 19394:19394/udp \
-e ZR_GATEWAY_PUBLIC_URL=https://relay.example.com:19393 \
-v zr-gateway-data:/data \
-v $(pwd)/certs:/certs \
kyomio/zen-remote-gateway:latestInspect the container logs after first boot to retrieve the one-time initial administrator password (default account admin@local; change it right after signing in):
docker logs zr-gateway- Single-port native TLS: Port
19393/tcpmultiplexes plaintext HTTP and HTTPS/WSS automatically. Placing a matchingfullchain.pemandprivkey.pempair inside/certs(or uploading them under Gateway Management -> TLS & Certificates in the console) enables TLS without setting up Nginx or Caddy. With this native TLS path, setZR_GATEWAY_PUBLIC_URLtohttps://relay.example.com:19393so generated invites point at the port the container actually publishes. Only omit the port (https://relay.example.com) when an external Nginx/Caddy proxy terminates TLS on 443 and forwards to the gateway. For first-boot LAN testing—or if you plan to hot-configure it later in the console—you can omit the variable entirely. Behind a reverse proxy, allow WebSocket upgrades on/peer/v1/wsand keep19393/udpplus19394/udppublished directly—TCP proxies cannot forward UDP STUN probes. - Admission modes and invite limits: Each network can enforce a join key, manual admin approval, or both. Invite links (
zr-net://) default to a 168-hour (7-day, configurable 1–720h) lifetime and 10 uses (configurable 1–1000). Rotating the join key in the console revokes the old link immediately.
Step 2: Join desktops and headless servers
Joining from the DSH desktop UI
After installing and enabling dsh-zen-remote on each workstation, open Plugins -> dsh-zen-remote in the left sidebar and click Start Setup Wizard:
- Step 1: Choose Peer Node (peer) as the runtime role.
- Step 2: Paste the
zr-net://invite link from the console (or switch to Gateway URL to sign in and pick a network under your account, or expand Advanced to enter the gateway URL, 16-hex network ID, and optional join key separately). - Step 3: Confirm all three status lights turn green—Local Identity, Network Admission, and Peer Discovery & Sync. Remote sessions shared by online peers then appear in your sidebar grouped by
Device · Workspace.

If the network requires manual admin approval, Step 3 pauses at Waiting for network admin approval. Once approved under Join Requests in the gateway console, the device comes online without needing to rerun the wizard.
Joining from a headless Linux server
On remote Linux servers running dsh web without a desktop window, the plugin includes a dsh-zen-remote CLI that drives the same onboarding flow over DSH's local IPC socket:
# Install the plugin, switch to peer role, and join the network in one step
npx dsh-zen-remote setup \
--role peer \
--invite "zr-net://relay.example.com/0123456789abcdef#join-key"Use these three subcommands for day-to-day checks and maintenance:
dsh-zen-remote peer status # Show local nodeId, admission state, live peer paths, and RTT (--json supported)
dsh-zen-remote peer trust <nodeId> # Review and trust a peer's new public key after a machine reinstall
dsh-zen-remote peer leave # Leave the virtual network while keeping phone QR access activeStep 3: Daily control, path selection, and troubleshooting
Per-session sharing and device controls
Joining a virtual network never exposes every workspace on your machine. A session only becomes visible on peer sidebars when you explicitly toggle Remote Access from the sidebar menu, session header globe button, mobile info sheet, or plugin settings (autoShareNewSessions can opt new sessions in automatically). Shared sessions auto-pause after 48 hours of idle turns (idleHours configurable), while running tasks or sessions awaiting permission/questions stay open.
Click Manage Network Devices on the plugin overview card to inspect every peer's live link type (Direct LAN / Direct P2P / Relayed / Offline / Key Mismatch) and latency, or toggle mounting per device without removing it from the network.
Three-tier routing and RTT thresholds
To keep terminal streams and tool approvals snappy without letting a congested direct route stall your session, dsh-zen-remote picks routes dynamically:
- Direct LAN (lan) and UDP hole punching (p2p) first: Devices on the same physical subnet connect directly (
100.64.0.0/10CGNAT ranges are excluded so virtual tailnets are not misclassified as physical LAN). Across separate networks, peers coordinate UDP hole punching through the gateway's dual STUN ports. Direct traffic never passes through the gateway or counts toward relay bandwidth caps. - 1-second relay fallback and RTT cap: Under symmetric NAT, strict UDP firewalls, or direct RTT sustained above the network's
peerDirectMaxRttMslimit (default300 ms, configurable per network in the console), traffic shifts within about 1 second to encrypted WebSocket relay—where the gateway reads only the 28-byte plaintext routing header. - Silent probing and smooth upgrade: While relayed, peers probe direct reachability in the background on a 3s -> 8s -> 25s backoff schedule. Once two consecutive probe samples succeed below the RTT cap, streams move back to direct P2P without interrupting open conversations or terminals.
Quick troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
Pasted zr-net:// link reports invalid, expired, or exhausted | Exceeded default 7-day TTL / 10-use limit, rotated join key, or missing #join-key suffix | Rotate the join key in the gateway console network settings (resets expiry and use count while invalidating old links) and recopy the full URL |
peer status stays in pending | The target network requires manual admin approval | Open Join Requests for that network in the gateway console and approve the device |
Peer stays online but always uses relay | At least one side sits behind symmetric NAT / blocked UDP, or 19393/udp & 19394/udp are closed | End-to-end encryption still holds; to unlock direct P2P, open both UDP ports on the gateway or place peers on the same intranet |
| Peer blocked with "Identity mismatch" | The remote machine reinstalled OS, cleared ~/.dsh/zen-remote-state.json, or reset state, triggering TOFU protection | Verify it is genuinely your machine, then click Trust New Identity in Manage Network Devices or run dsh-zen-remote peer trust <nodeId> |
| Some machines never appear in the sidebar | Network reached maxPeers (default 8, range 2–64) or local maxServers cap (default 8, up to 64) | Increase maxPeers on the console network page or raise the local max mounted hosts setting |
Frequently Asked Questions (FAQ)
Can I still pair my phone when all my computers run in peer mode? Yes. Running as a peer keeps the machine's built-in host mobile gateway active, so browser and PWA QR pairing keep working as usual. Just remember that lock-screen push notifications require opening the mobile UI over a trusted HTTPS origin (such as built-in Caddy, Cloudflare Tunnel, or a reverse proxy); plain LAN HTTP still works for live chat viewing.
What if I only want my laptop to view sessions on my desktop without sharing laptop sessions back? Both machines can still run peer inside the same network—simply leave Remote Access turned off on the laptop's sessions, since peers only broadcast explicitly enabled sessions. Alternatively, keep the desktop on host mode and switch the laptop to client mode using an 8-digit pairing code.
How do I check which sessions a headless server is sharing and whether it uses direct or relay? Run dsh-zen-remote peer status on the server (append --json for scripts) to view the machine's nodeId, admission state, per-peer paths (lan / p2p / relay), and measured RTT. Run dsh-zen-remote status for the overall service status and active shared session list.
Will active direct sessions drop if gateway-server restarts briefly? Existing lan and p2p streams stay connected directly between peers for a short outage without needing the gateway in the data path. Once the gateway returns, peers reconnect their control WebSocket automatically to resume device discovery, new handshakes, and relay fallback readiness.



