r/opencode • • 20d ago

Is it possible to automatically fall back to a tunnel when LAN and Tailscale connections are unavailable on iOS?

Hi everyone!

I'm currently using the official OpenCode iOS app to connect to OpenCode instances running on my home Mac and a remote VPS.

Right now, I'm connecting through either:

  • LAN: Direct connection using the local IP address when I'm at home.
  • Tailscale: Connecting through my tailnet when I'm away from home.
  • Tunnel: I'd like to use the built-in tunnel as a fallback when neither of the above works.

Ideally, I'd like OpenCode to automatically choose the connection method in this order:

  1. LAN (highest priority) — Use the direct local connection when available.
  2. Tailscale — Use the Tailscale connection when LAN is unavailable.
  3. Tunnel (fallback) — Automatically switch to the built-in tunnel if both LAN and Tailscale fail.

My goal is to have a seamless experience without manually changing connection settings whenever I switch networks.

My questions:

  • Does the current iOS app support automatic connection fallback or any kind of connection priority?
  • Is it possible to enable the built-in tunnel while still preferring direct LAN/Tailscale connections?
  • If this isn't currently supported, is it something that could be considered as a feature request?

I'd really appreciate any suggestions or workarounds. Thanks!

1 Upvotes

3 comments sorted by

1

u/FallElectronic3774 19d ago

If you mean OpenCode Mobile (the community iOS/Android client, not an official OpenCode product), its connection handling is manual: Settings → Connection lets you save LAN, Tailscale, and Cloud Link profiles, but you pick the active one; there is no LAN → Tailscale → tunnel priority or automatic fallback in the current app. Cloud Link is a separate managed route, not a fallback that can stay enabled behind the other two. The practical workaround is to use one route that works everywhere (Cloud Link or a Cloudflare Tunnel URL) and keep the LAN/Tailscale profiles for manual switching when you want direct speed; a single hostname with split DNS can resolve to LAN at home and Tailscale away, but it still won't fall back if Tailscale is down. The feature request is reasonable — open an issue on the OpenCode Mobile GitHub with the priority order you described.

1

u/letusstarthere 18d ago

Thanks for the detailed explanation! I actually just noticed today that OpenCode Mobile now supports a fallback option in the connection settings.

Looks like this feature has already been implemented, so that's great news!

Really appreciate your help!