Navin

Publish preview (Cloudflare Quick Tunnel)

In the Dev module, the Preview tab can expose your local development server to the Internet through a Cloudflare Quick Tunnel (*.trycloudflare.com). Useful for demos, webhooks, or mobile testing - not production hosting.

No Cloudflare account is required. Navin runs cloudflared (from PATH, or downloaded once into the instance data directory).

Auto-open Preview

When the agent scaffolds or starts a web app, it calls open_preview after the local server responds (curl). The Preview iframe opens with that URL automatically - no manual Open click. For Android, mobile(action="preview_start") opens the Mobile tab the same way. Publish (public tunnel) stays manual.

On a narrow screen (phone), the Dev chat becomes a bottom sheet so Preview can use the full width; auto-open also collapses the chat so the app stays in focus.

Usage

  1. Start a dev server in the project (npm run dev, etc.) - or let the agent do it.

  2. Open Preview (auto-opened when the agent calls open_preview) and confirm the local URL (e.g. http://127.0.0.1:5173).

  3. Click Publish next to Open.

  4. Navin reads the port from that URL (it often changes on every Vite/Next start) and runs:

    cloudflared tunnel --url http://127.0.0.1:<port> \
      --http-host-header 127.0.0.1:<port> --no-autoupdate
    
  5. The public URL (https://….trycloudflare.com) appears: copy, open, or Stop.

The tunnel rewrites the Host header to 127.0.0.1:<port>, so Vite / Next / etc. do not need allowedHosts in their config.

Requirements: Internet access. Publishing is localhost-only (same machine as the gateway). On first use, the cloudflared binary may be downloaded automatically.

What it is not

ExpectationReality
Permanent production hostingNo - temporary tunnel to your machine
Custom domain mysite.comNo - random *.trycloudflare.com URL
Cloudflare account requiredNo

Do I need a Cloudflare account?

GoalCloudflare account?
Quick share via Publish (Quick Tunnel)No
Your domain / subdomainYes - named Cloudflare tunnel, out of current scope

Gateway API

Authenticated routes (Authorization: Bearer …), localhost controls only:

RouteRole
GET /api/webui/preview-tunnelStatus (active, port, URL)
GET /api/webui/preview-tunnel/start?port=5173Start cloudflared and wait for the public URL
GET /api/webui/preview-tunnel/stopStop the tunnel

Implementation: navin/webui/preview_tunnel_api.py. The tunnel is stopped when the gateway shuts down.

Troubleshooting

MessageLikely causeHint
This host is not allowed (Vite)Older tunnel without Host rewriteStop, then Publish again (Navin sends Host: 127.0.0.1)
could not download cloudflaredNetwork / GitHub unreachableCheck Internet, or install cloudflared on PATH
Nothing is listening on that local portDev server not runningStart the server, publish again
Enter a local URL with a portURL without an explicit porte.g. http://127.0.0.1:5173
preview tunnel is localhost-onlyRemote gateway accessPublish from the machine running Navin

Related

Source: content/docs/navin_dev/en/preview-publish.md