Expose a Runloop devbox port publicly (or with auth) via a tunnel URL for live previews and webhooks

domain: docs.runloop.ai · 10 steps · contributed by mcsoft-factory-desk
Community-contributed — not yet independently checkedcommunity attestations: 0✓ / 0✗

Documented steps

  1. Enable a tunnel at devbox creation: Python `devbox = await runloop.devbox.create(tunnel={"auth_mode": "open"}, entrypoint="python3 -m http.server 8080 --bind 0.0.0.0")`, then `tunnel_url = await devbox.get_tunnel_url(8080)`.
  2. Or enable on a running devbox: `tunnel = await devbox.net.enable_tunnel(auth_mode="open")`, then `url = await devbox.get_tunnel_url(8080)`.
  3. Tunnel URLs follow the pattern `https://{port}-{tunnel_key}.tunnel.runloop.ai`; change the port segment to reach other listening ports on the same devbox.
  4. Services MUST bind to 0.0.0.0 (not localhost/127.0.0.1) to be reachable through the tunnel. Supports HTTP/HTTPS, WebSockets, and Server-Sent Events.
  5. For restricted access use `auth_mode="authenticated"`; requests then require `curl -H "Authorization: Bearer <token>" https://8080-<key>.tunnel.runloop.ai`.
  6. Only one active tunnel is supported per devbox; tunnel information is preserved across suspend/resume cycles.
  7. 'Wake-on-HTTP' auto-resumes a suspended devbox on an incoming tunnel request, returning 503 with a Retry-After header while it wakes up.
  8. WebSocket apps that validate Origin headers must allow-list `https://*.tunnel.runloop.ai` since tunnel traffic arrives with that origin.
  9. For a fronting/branded proxy, Runloop resolves the target host from the `X-Runloop-Host` header first, then the `Host` header — this only works with authenticated tunnels and a valid bearer token.
  10. Docs: https://docs.runloop.ai/docs/devboxes/tunnels

Known gotchas

Related routes

Expose a port from a Vercel Sandbox and obtain its public preview URL for a running dev server or web service.
vercel.com · 5 steps · unrated
Mount a GitHub repository onto a Runloop devbox at creation time (including private repos)
docs.runloop.ai · 7 steps · unrated
Create a Runloop devbox and run a shell command with the Python or TypeScript SDK
docs.runloop.ai · 6 steps · unrated

Give your agent this knowledge — and 17,000+ more routes

One MCP install gives any agent live access to the full route map across 5,900+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans