Skip to content

[Feature]: Self-hosted relay server based mobile & desktop connections #2471

Open
lexasoft123/orca
#6

Description

@itizarsa

Problem or use case

If we have the option to connect the mobile app with desktop through a relay server, it would avoid the necessity to be on same local/tailnet network.

Proposed solution

Refer Paseo Relay - https://paseo.sh/docs/security#relay-connections-recommended

Alternatives or additional context

No response

Activity

  1. added
    enhancement
    on May 21, 2026
  2. nwparker commented on May 29, 2026

    @nwparker
    Contributor

    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:

    1. 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.
    2. 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.
    3. 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.
    4. 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.
    5. 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.
    6. 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:

    1. 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.
    2. 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.
    3. Add a local/in-process relay simulation test harness first, covering two-leg routing, revocation, reconnect, binary forwarding, and mobile/runtime scope enforcement.
    4. 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.
    5. 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.

  3. added
    size/xl
    on Jun 10, 2026
  4. added theissue type on Jul 12, 2026
  5. nwparker commented on Oct 18, 2026

    @nwparker
    Contributor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementmobilesize/xl

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions