localhostforonline
v1.9.0
Published
Expose your localhost to the internet
Maintainers
Readme
localhostforonline
Expose your local development server to the internet in seconds. No configuration, no DNS setup, no TLS certificates — just a single command.
npx localhostforonline --port 3000Quick start
# Expose a local HTTP server on port 3000
npx localhostforonline --port 3000
# Output:
# Tunnel created!
# ✓ Your URL: https://a1b2c3d4-e5f6-7890-abcd-ef1234567890.localhostfor.online
# ✓ Local: localhost:3000
# ✓ Logs: https://localhostfor.online/dashboard?session=a1b2c3d4-e5f6-7890-abcd-ef1234567890Open the generated URL in your browser — your local app is now online.
How it works
Visitor → localhostfor.online (edge proxy) → secure tunnel → your machine (localhost:3000)- You start a tunnel from your machine to
localhostfor.online - The platform generates a unique public URL:
https://<uuid>.localhostfor.online - Anyone with that URL can access your local server through the tunnel
- All requests are logged in real time to your dashboard
Features
Secure tunnels
All traffic is encrypted end-to-end via TLS. Your local server is never directly exposed to the public internet. HTTPS by default.
Live dashboard
Monitor every request in real time:
- Stats: Total requests, bandwidth, average latency, tunnel status
- Request log: Method, URL, status code, size, duration — for every request
- Request details: Expand any request to see full headers and body (request + response)
- Tunnel history: All tunnels you've created, with quick access to their logs
WebSocket support
Full-duplex communication, auto-detected — no extra flags needed. When the server detects an Upgrade: websocket header, it automatically upgrades to WebSocket forwarding.
Custom subdomains
Reserve a custom subdomain for your tunnel to get a predictable, shareable URL:
npx localhostforonline --port 3000 --subdomain my-app
# → https://my-app.localhostfor.onlineTCP forwarding
Raw TCP support for any protocol — SSH, databases, SMTP, and more:
npx localhostforonline --port 22 --tcpAPI keys & account
Link your tunnels to an account for permanent history and management:
- Log in at https://localhostfor.online/login with your Google account
- Run
localhostforonline loginin your terminal - Start a tunnel:
npx localhostforonline --port 3000
Anonymous access
Even without an account, anyone with a tunnel URL can view its request history:
https://localhostfor.online/dashboard?session=<uuid>CLI commands
Root command — Start a tunnel
localhostforonline [flags]Exposes a local port to the internet. Supports HTTP, WebSocket, and TCP.
login — Authenticate the CLI
localhostforonline loginOpens a browser window for Google OAuth and persists your API key to ~/.localhostfor/config.yaml.
Use localhostforonline login --no-browser to print the authentication URL instead of opening a browser.
whoami — Show current user
localhostforonline whoamiCLI flags
| Flag | Type | Description |
|------|------|-------------|
| --port | int | Local port to expose (e.g. 3000) |
| --url | string | Full local URL (e.g. http://localhost:8080) |
| --subdomain | string | Reserve a custom subdomain for your tunnel (requires login) |
| --host-header | string | Rewrite Host header (rewrite = set to localhost:<port>) |
| --tcp | bool | Enable raw TCP forwarding (allocates a dedicated port) |
| --dev | bool | Force dev mode (auto-detected for Next.js) |
Either
--portor--urlis required, but not both.
Output format
Tunnel created!
✓ Your URL: https://a1b2c3d4-e5f6-7890-abcd-ef1234567890.localhostfor.online
✓ Local: localhost:3000
✓ Logs: https://localhostfor.online/dashboard?session=a1b2c3d4-e5f6-7890-abcd-ef1234567890
✓ TCP Port: 20000 (only when using --tcp)
Press Ctrl+C to stopWhen using a custom subdomain, the logs URL becomes:
✓ Logs: https://localhostfor.online/subdomains/my-app/logsProtocol support
| Protocol | How | Example |
|----------|-----|---------|
| HTTP (default) | All methods: GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS, CONNECT | npx localhostforonline --port 3000 |
| WebSocket | Auto-detected via Upgrade: websocket header | Same command — no extra flags |
| TCP | Dedicated TCP port for raw byte relay | npx localhostforonline --port 22 --tcp |
TCP forwarding
When using --tcp, the server allocates a dedicated TCP port. Connect by sending the 36-byte project UUID (without the project- prefix) first, then your raw data:
# Expose SSH
npx localhostforonline --port 22 --tcp
# Connect from another terminal
printf 'a1b2c3d4-e5f6-7890-abcd-ef1234567890' | nc localhostfor.online 20000Installation
Via npx (no install required)
npx localhostforonline --port 3000Via global npm
npm install -g localhostforonline
localhostforonline --port 3000Platform
Website
/— Landing page with documentation/onboarding— Get started and create an account/dashboard— Tunnel list and request history/dashboard?session=<uuid>— Request log for a specific tunnel/login— Sign in with Google to get an API key/account— Your account details
Need help?
For consultation or help becoming a tech provider, contact us on WhatsApp: +55 11 96743-5133
