Skip to content

[Feature]: Make relay endpoint configurable / support self-hosted relay #10577

Open
lexasoft123/orca
#6

Description

@omarshibli

Problem or use case

I'm using Orca Relay from the Middle East and hitting noticeable performance
issues — everything routes through relay.onorca.dev, so the round trip is long
enough to make the mobile terminal feel laggy.

Proposed solution

It would be great to be able to configure the relay endpoint, ideally with the
option to run my own self-hosted relay closer to me. A region-aware cell
assignment would also solve it if self-hosting is too much scope.

Happy to test either.

Alternatives or additional context

No response

Activity

  1. added
    enhancement
    on Jul 25, 2026
  2. AmethystLiang commented on Jul 25, 2026

    @AmethystLiang
    Contributor

    self-hostable relay is coming in 1-2 days!

  3. omarshibli commented on Jul 25, 2026

    @omarshibli
    Author

    Amazing!

  4. omarshibli commented on Jul 30, 2026

    @omarshibli
    Author

    Hey, would appreciate if you can provide any update. 🙏

  5. iiiusky commented on Sep 13, 2026

    @iiiusky

    Is there any new progress?

  6. wangbaoyi commented on Nov 15, 2026

    @wangbaoyi

    Strong +1 from mainland China — this is currently the biggest blocker for using Orca Mobile remotely.

    What I see: with Orca Relay, the round trip to relay.onorca.dev is long and unstable from mainland China. The mobile terminal feels laggy, and the connection is not always stable (slow responses, occasional drops/reconnects). Direct LAN / Tailscale pairing is smooth, but on a mobile network I cannot always keep both devices on the same tailnet, so Relay is the only official "works from anywhere" path — and it is the slow one.

    Requests, in priority order:

    1. Self-hosted relay (as mentioned earlier in this thread). If the phone↔desktop channel is end-to-end encrypted, a relay only forwards ciphertext, so running one on a nearby VPS (Hong Kong / Singapore / mainland China) would fix latency without weakening the security model.
    2. If self-hosting is still far out, a configurable relay endpoint and/or regional relay cells (Asia / China) would already help a lot.
    3. A direct-address fallback when Relay degrades, instead of staying on Relay after pairing.

    Is there any update on the self-hostable relay mentioned above? Happy to test a self-hosted relay or a regional endpoint from mainland China, and happy to provide latency / traceroute data if that helps.

  7. wangbaoyi commented on Nov 15, 2026

    @wangbaoyi

    Update after reading the public source: the self-hosted relay MVP may be smaller than it looks — most of the plumbing is already public.

    I went through cloud/ and the desktop/mobile relay code. What already exists today:

    • cloud/apps/relay is public MIT source with a Dockerfile, and ORCA_RELAY_ROLE=combined|director|cell (default combined) lets one process act as director + cell. Per cloud/README.md, ORCA_RELAY_ASSIGNMENT_SIGNING_KEY is the only required secret; DATABASE_URL is optional (Postgres in production, SQLite for local dev).
    • The desktop already accepts a non-production director: ORCA_RELAY_URL overrides https://relay.onorca.dev in profile-cloud-auth-config.ts (packaged builds require HTTPS; loopback HTTP only in dev).
    • The pairing offer (mobile-relay-pairing-offer.ts) already carries relay.directorUrl / relay.cellUrl and only requires a canonical HTTPS origin — there is no *.onorca.dev allowlist — and the phone dials the offer's directorUrl (mobile-relay-invite-director.ts).
    • The region contract already has us-central1 and asia-east2 (relay-regions.ts).

    So the missing piece is not the protocol, but an officially supported deployment path. Concrete gaps:

    1. Deployable artifact + docs. Publish a multi-arch relay image (or an orca relay subcommand) with a documented docker run for ORCA_RELAY_ROLE=combined: required env (ORCA_RELAY_PUBLIC_URL, ORCA_RELAY_CELL_URL, ORCA_RELAY_AUTH_ISSUER, ORCA_RELAY_JWKS_URL, ...), TLS / reverse-proxy setup, health endpoint, and upgrade/rollback steps. Also make the GCP-only required vars (ORCA_RELAY_ADMIN_AUDIENCE, ORCA_RELAY_DEPLOY_SERVICE_ACCOUNT) optional in combined / self-hosted mode — today they must be set even for a single-box deployment.
    2. Auth guidance. Can a self-hosted relay validate relay tokens issued by login.onorca.dev by pointing ORCA_RELAY_AUTH_ISSUER / ORCA_RELAY_JWKS_URL at the official service, so operators do not have to run an IdP? Please document this, including whether an Orca account or entitlement is required.
    3. Desktop UI. Surface ORCA_RELAY_URL in Settings (Remote/Mobile) with origin validation and connection health, instead of requiring an environment variable. Show "self-hosted relay" and the assigned cell/region in the connection status.
    4. Failure handling. Let the pairing offer carry an ordered endpoint list (LAN → Tailscale → relay) and have the client probe / fail over. That addresses instability, not only latency, and is useful even on the official relay.
    5. Region / China. asia-east2 exists, but users in mainland China still report high latency and drops to relay.onorca.dev. Please add a region selector/status and more Asia cells (Singapore/Tokyo), and document self-hosted relay as the supported answer for mainland China — a nearby VPS is the only realistic fix there.

    Suggested MVP: Phase 1 (combined relay container + ORCA_RELAY_URL + Settings field + docs) would already unblock users in high-latency regions. Phase 2: endpoint failover + region selection. Phase 3: operator-owned auth issuer and multi-cell.

    I am happy to build and test Phase 1 from mainland China, and report before/after latency and traceroute. If a PR is welcome, tell me the preferred shape (self-hosted relay docs vs. an orca relay command) and I can draft it.

  8. lexasoft123 commented on Nov 21, 2026

    @lexasoft123
    Contributor

    I've opened #46239 for this. It lets you run your own relay and point the desktop at it:

    • Settings → Mobile → Custom relay server on the desktop, with a connection test and a clean switch (signs out and drops relay pairings from the old server; LAN pairings stay).
    • cloud/apps/relay-auth, a small sign-in service that issues the tokens the relay already verifies. By default one admin signs in with a secret; optionally it hands login to your own OIDC provider (tested with Zitadel).
    • cloud/self-hosted, a Docker Compose example that runs the relay and the sign-in service behind Caddy with automatic HTTPS on one domain.

    How sign-in works: only the desktop signs in, against your server instead of login.onorca.dev. The phone doesn't sign in at all, same as with the hosted relay today: it pairs by scanning the desktop's QR code, which carries the relay address and a one-time invite, and its traffic to the desktop stays end-to-end encrypted.

    No phone app update needed: because the QR code tells the phone which relay to use, the current App Store and Play Store builds work with a self-hosted relay as they are.

    This covers Phase 1 and the operator-owned sign-in from Phase 3 of the plan in the comment above. Endpoint failover, region selection and multi-cell setups aren't included. I've run it on a small VPS with a macOS desktop and an Android phone, and the end-to-end test also passes on Windows. Happy to reshape or split it if maintainers prefer a different approach.

  9. zbl-jerry commented on Nov 26, 2026

    @zbl-jerry

    +1, we really need this. In China, the mobile app keeps timing out and reconnecting, which makes remote work from a phone basically impossible.

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

Metadata

Metadata

Assignees

Labels

enhancementmobile

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions