@vishota2
Vlad MishotaDeveloper▲6
Programmer, Independent
24m ago · Article · Testing and Evals, Vibe-coding, General Discussion · Minsk

One-command HTTPS tunnel to localhost (P2P-first + relay fallback)

2 min read

virunx exposes a local port over a public HTTPS URL (HTTP(S), WebSockets, SSE) in a single command — with no auth setup and CLI-driven configuration.

npx virunx -p 3000 -s test
# -> https://test.run.vishota.com (-s is optional, defaults to project name)
Architecture & why P2P matters

Instead of routing every byte through a central server by default, virunx establishes a peer-to-peer connection first and uses the relay proxy only as a fallback:

  • ICE negotiation connects the client and local host directly, falling back to the relay proxy if direct connection fails or stalls.
  • Works even behind Symmetric NAT, and can run ICE over TCP when UDP is blocked.
  • Because the server mostly handles signaling rather than full traffic proxying, hosting stays cheap and the public instance ([https://run.vishota.com/](https://run.vishota.com/)) can remain free without aggressive bandwidth caps.
Built-in dev & privacy controls
  • Automatic Host header rewriting: Rewrites Host to localhost: by default so local dev servers (Vite, webpack, etc.) accept incoming traffic without config changes. Pass --no-rewrite-host to preserve the original public Host header.
  • Traffic routing flags:
  • --no-p2p — route all visitor traffic through the relay server
  • --no-fallback — disable proxy fallback for visitors (server handles only page HTML and signaling)
  • --no-proxy — strict signaling-only mode; zero payload data touches the server (visitors without a direct P2P path receive an explanation instead)
  • --hidden — hide the tunnel from the relay's public listing page
  • Other commands: virunx list shows active tunnels, links, ports, and traffic on the current machine.
Use cases
  • Testing HTTPS-only browser features locally (Secure cookies, OAuth callbacks, camera/geolocation APIs, mixed content)
  • Sharing local builds or live demos on calls and across devices without deploying
  • Remote access to local services behind NAT (e.g., agentic coding boards like viboard or self-hosted setups on constrained hardware)
Known trade-offs & current roadmap
  • Relay bandwidth prioritization: Sustained heavy relay-proxied traffic lowers the host's priority in bandwidth allocation compared to lighter consumers.
  • Tab lifecycle on downloads: Closing a browser tab mid-download drops the WebRTC/ICE stream; the download automatically resumes via the relay proxy.
  • Public subdomain model: Any free subdomain can be claimed on demand, which introduces session-hijacking risks if sensitive local endpoints are left exposed.
  • In progress: stress-testing P2P stability under heavy relay load, validating strict no-proxy edge cases, and isolating the tunnel endpoints onto a dedicated domain.
  • npm: https://www.npmjs.com/package/virunx
  • Service & stats: https://run.vishota.com/
  • Technical write-up (RU): https://vishota.com/articles/pereadresatsiya-zaprosov-s-https-domena-na-lokalnyy-port-za-b8329613
devtoolsTools

Comments

No comments yet
Start the conversation.
Log in to join the thread.