Skip to content

Add Tailscale as a tunnel provider #25

Description

@VincentJGeisler

The tunnel provider list currently supports cloudflare, ngrok, and localtunnel (see TUNNEL_PROVIDER env var / VALID_PROVIDERS in index.js, and the tunnel-setup CLI's provider picker). For the common case of "reach my dev machine from my phone," Tailscale is arguably a better fit than any of these:

  • No public exposure at all — traffic stays on the user's private tailnet (WireGuard), vs. cloudflare/ngrok/localtunnel which all proxy through a third-party public endpoint.
  • No account/authtoken setup, no interstitial pages, no rate limits.
  • Stable addressing via MagicDNS (<host>.<tailnet>.ts.net) or a fixed tailnet IP — doesn't churn on every restart like the free tiers of the existing providers.
  • Already covers the "remote access when off-LAN" case that localtunnel/ngrok exist for, but privately.

Two ways this could be implemented, in increasing order of effort:

  1. Cheapest: document/officially support the existing ServerUrl[...] direct-connect path (/mobile ExponentPushToken[xxx] ServerUrl[http://<tailscale-ip>:<port>]) as the recommended Tailscale flow, since it already bypasses the tunnel system entirely when the phone and host share a tailnet. Right now this is only mentioned in passing in the /mobile command help text — a docs callout would go a long way.
  2. Full support: add a tailscale provider (src/tunnel/tailscale.ts) that shells out to tailscale serve --bg --https=443 http://127.0.0.1:<port> and parses the resulting https://<host>.<tailnet>.ts.net URL, wired into VALID_PROVIDERS, TUNNEL_PROVIDER, and the tunnel-setup CLI picker the same way cloudflare is. This also sidesteps the CORS/account complexity cloudflare setup currently requires.

Happy to open a PR for option 2 if there's interest in the approach.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions