You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature]: Self-hosted relay server based mobile & desktop connections #2471
Triage result (2026-05-29): this is useful, but it is not a bounded implementation slice yet. The issue asks for a self-hosted relay so mobile and desktop can connect without being on the same LAN/tailnet, and links Paseo's relay security model as the desired shape. I inspected origin/main at 399ad3e42de240b262022e665b423803a12c6ad8; the current architecture is intentionally direct-connect and the relay work would need a small protocol design before code changes are safe.
Architecture facts inspected:
src/shared/pairing.ts:3 and mobile/src/transport/pairing.ts:3 define pairing offer v2 as exactly endpoint, deviceToken, and publicKeyB64; mobile mirrors the shared format, so any relay-aware pairing format is a cross-client compatibility change.
src/main/ipc/mobile.ts:13 documents that the runtime WebSocket transport advertises 0.0.0.0, so desktop enumerates non-internal IPv4 interfaces and lets the user choose LAN/Tailscale/custom addresses before QR generation.
src/main/runtime/runtime-rpc.ts:401 creates pairing offers by embedding a direct WebSocket endpoint plus a per-device token and desktop E2EE public key; src/main/runtime/device-registry.ts:1 says WebSocket/mobile auth is per-device and revocable.
src/main/runtime/rpc/e2ee-channel.ts:1 puts application-layer E2EE above the transport, with a token-authenticated handshake; src/main/runtime/runtime-rpc.ts:820 rejects mismatched/missing device tokens and enforces the mobile allowlist for mobile-scoped grants.
mobile/src/transport/rpc-client.ts:83 defines mobile reconnect backoff and give-up behavior, while mobile/src/transport/connection-health.ts:3 maps repeated failures to user-facing health states.
src/renderer/src/components/settings/RuntimePairingUrlGenerator.tsx:331 already supports direct custom host, host:port, or wss://host/path endpoints, and its UI copy explicitly points users at LAN, Tailscale, or custom direct addresses.
The existing src/relay/relay.ts:12 and src/main/ssh/ssh-relay-deploy.ts:45 relay code is an SSH-deployed remote-host daemon over an already-authenticated SSH channel; it is not a public rendezvous/forwarding relay for mobile, web, or desktop clients.
Open design decisions before implementation:
Pairing and relay trust model: the current QR is a bearer credential plus desktop public key. A self-hosted relay should route opaque E2EE frames and should not learn plaintext RPCs or reusable device tokens. We need to decide whether the relay identity/fingerprint is pinned in the pairing offer, whether the relay can be prevented from swapping the desktop public key, whether relay grants are bound to a desktop session, and how revocation terminates relay-side sockets.
Mobile/desktop routing: today's model is one client WebSocket directly to the desktop runtime. Relay mode needs a two-leg model such as desktop-to-relay plus mobile/web/desktop-client-to-relay, with session IDs, routing frames, binary stream multiplexing, connection limits, and backpressure rules.
Authentication: the existing DeviceRegistry has mobile/runtime scopes and revocable tokens. Relay mode needs a way to authenticate both legs without exposing device tokens to relay logs or operators, plus admin/auth config for the self-hosted relay itself.
Reconnect semantics: mobile currently gives up after bounded retries, the server has WebSocket heartbeat/pre-auth timeouts, and the web runtime client reconnects differently. Relay mode needs explicit behavior for desktop offline windows, client reconnecting to the same session, relay restart, message ordering, TTLs, and user-facing errors.
Self-host deployment surface: this likely needs a new package/container/binary, TLS/wss guidance, config schema, health/status endpoints, rate limits, observability, and version compatibility. The existing SSH relay should not be reused as-is because it has a different trust boundary and transport model.
Compatibility with local/tailnet flows: direct LAN/Tailscale/custom endpoints should remain the default. Relay support probably belongs as an additional transport candidate or pairing-offer version, not as a replacement for v2 direct pairing, and it must not regress mobile pairing, web runtime pairing, desktop runtime environments, or SSH remote runtimes.
Suggested migration plan:
Write a short design spec for PairingOffer v3 or transport candidates that preserves v2 direct pairing compatibility while adding relay metadata, relay identity, and a session/grant envelope.
Define a relay protocol and threat model where the relay routes opaque E2EE frames and never needs to decrypt RPC payloads or persist device tokens.
Add a local/in-process relay simulation test harness first, covering two-leg routing, revocation, reconnect, binary forwarding, and mobile/runtime scope enforcement.
Add desktop Settings support for an optional self-host relay URL and relay pairing code generation, while keeping the current LAN/Tailscale/custom direct QR path unchanged.
Ship the self-host deployment artifact and docs after the protocol tests establish the compatibility contract.
I do not see a tiny safe implementation slice to land today without making protocol decisions first. Even a seemingly small parser change, like adding a relay field to the pairing offer, crosses shared desktop, mobile, web, auth, and reconnect behavior and should follow the design/protocol step above.
Consolidating #26904 here: it requests a self-hosted relay so Orca Mobile can reach designated hosts when a VPN is not an option. Its community reply suggests orca serve plus Tailscale; that is useful direct-connect advice but does not meet the no-VPN relay requirement this issue already tracks. Please retain that deployment constraint. Original discussion: #26904.
Activity
nwparker commentedon May 29, 2026
Triage result (2026-05-29): this is useful, but it is not a bounded implementation slice yet. The issue asks for a self-hosted relay so mobile and desktop can connect without being on the same LAN/tailnet, and links Paseo's relay security model as the desired shape. I inspected
origin/mainat399ad3e42de240b262022e665b423803a12c6ad8; the current architecture is intentionally direct-connect and the relay work would need a small protocol design before code changes are safe.Architecture facts inspected:
src/shared/pairing.ts:3andmobile/src/transport/pairing.ts:3define pairing offer v2 as exactlyendpoint,deviceToken, andpublicKeyB64; mobile mirrors the shared format, so any relay-aware pairing format is a cross-client compatibility change.src/main/ipc/mobile.ts:13documents that the runtime WebSocket transport advertises0.0.0.0, so desktop enumerates non-internal IPv4 interfaces and lets the user choose LAN/Tailscale/custom addresses before QR generation.src/main/runtime/runtime-rpc.ts:401creates pairing offers by embedding a direct WebSocket endpoint plus a per-device token and desktop E2EE public key;src/main/runtime/device-registry.ts:1says WebSocket/mobile auth is per-device and revocable.src/main/runtime/rpc/e2ee-channel.ts:1puts application-layer E2EE above the transport, with a token-authenticated handshake;src/main/runtime/runtime-rpc.ts:820rejects mismatched/missing device tokens and enforces the mobile allowlist for mobile-scoped grants.mobile/src/transport/rpc-client.ts:83defines mobile reconnect backoff and give-up behavior, whilemobile/src/transport/connection-health.ts:3maps repeated failures to user-facing health states.src/renderer/src/components/settings/RuntimePairingUrlGenerator.tsx:331already supports direct customhost,host:port, orwss://host/pathendpoints, and its UI copy explicitly points users at LAN, Tailscale, or custom direct addresses.src/relay/relay.ts:12andsrc/main/ssh/ssh-relay-deploy.ts:45relay code is an SSH-deployed remote-host daemon over an already-authenticated SSH channel; it is not a public rendezvous/forwarding relay for mobile, web, or desktop clients.Open design decisions before implementation:
DeviceRegistryhas mobile/runtime scopes and revocable tokens. Relay mode needs a way to authenticate both legs without exposing device tokens to relay logs or operators, plus admin/auth config for the self-hosted relay itself.Suggested migration plan:
PairingOfferv3 or transport candidates that preserves v2 direct pairing compatibility while adding relay metadata, relay identity, and a session/grant envelope.I do not see a tiny safe implementation slice to land today without making protocol decisions first. Even a seemingly small parser change, like adding a relay field to the pairing offer, crosses shared desktop, mobile, web, auth, and reconnect behavior and should follow the design/protocol step above.
nwparker commentedon Oct 18, 2026
Consolidating #26904 here: it requests a self-hosted relay so Orca Mobile can reach designated hosts when a VPN is not an option. Its community reply suggests
orca serveplus Tailscale; that is useful direct-connect advice but does not meet the no-VPN relay requirement this issue already tracks. Please retain that deployment constraint. Original discussion: #26904.