Expose Localhost to the Internet
Developers search for how to expose localhost when they need to share a work-in-progress app, test webhooks, or demo to someone who is not on their LAN. Asyx is a secure tunnel: your machine keeps running the app; Asyx provides a public HTTPS front door.
What “expose localhost” means
Your app binds to 127.0.0.1 or localhost so only your computer can reach it. A tunnel forwards traffic from a public URL to that local port. Visitors use HTTPS; your firewall stays closed; you control when the tunnel is on.
When a tunnel beats deploying
| Situation | Tunnel | Full deploy |
|---|---|---|
| Quick demo or PR preview | ✅ Minutes | ❌ Hours |
| Webhook callback testing | ✅ Stable URL | ⚠️ Staging env |
| AI agent built a local prototype | ✅ One command | ❌ Overkill |
| Production traffic at scale | ⚠️ Fair-use caps | ✅ Purpose-built |
For validation and sharing, tunnels win on speed. For long-running production, deploy to your cloud when ready.
How Asyx does it
- Enroll —
asyx setupbinds a device certificate and reserveshttps://<name>.tunnel.asyx.ai. - Tunnel —
asyx tunnel --http --port <n>maps public HTTPS to your local port. - Share — Send the URL; TLS and routing are handled automatically.
- Stop —
Ctrl+Ccloses the public route instantly.
Only your enrolled device can open tunnels. That is stronger than sharing a long-lived API key on a shared agent.
Quick start
npm install -g asyx
asyx setup
# start your app on port 3000, then:
asyx tunnel --http --port 3000
See Publish in 60 Seconds for a step-by-step walkthrough.
Security basics
- TLS everywhere — Visitors connect over HTTPS.
- Device-bound — Tunnel control requires your provisioned certificate.
- Short-lived credentials — Session JWTs refresh in-band; no static tunnel secrets in git.
- Optional access control — Quickpass can restrict who reaches a protected tunnel.
Common ports
| Stack | Typical port |
|---|---|
| Next.js / React (Vite) | 3000, 5173 |
| Flask / Django | 5000, 8000 |
| Express | 3000, 8080 |
Static python -m http.server | 8000 |
Related guides
- Expose Web + API — one origin for SPA and backend
- AI agents — share what your coding assistant built
- Security comparison — architecture vs ngrok and Cloudflare
FAQ
Is exposing localhost safe?
You choose what port to publish and when the tunnel runs. Do not expose admin interfaces or databases without access controls. Use Quickpass when the demo should not be public.
Does Asyx replace ngrok or Cloudflare Tunnel?
For many dev and demo workflows, yes. See vs ngrok & Cloudflare for a developer-focused comparison or the security comparison for architecture depth.
Do I need port forwarding on my router?
No. Outbound connection from your machine is enough.
What are usage limits?
Fair-use caps apply on the free tier. Details appear in the console after you sign up.