localhostforonline
v1.2.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 tunnel --port 3000How it works
Visitor → localhostfor.online → secure tunnel → your machine (localhost:3000)- You start a tunnel from your machine to
localhostfor.online - The platform generates a unique public URL:
https://localhostfor.online/project-<uuid> - Anyone with that URL can access your local server through the tunnel
Quick start
# Expose a local HTTP server on port 3000
npx localhostforonline tunnel --port 3000
# Output:
# Tunnel created!
# ✓ Your URL: https://localhostfor.online/project-abc123
# ✓ Local: localhost:3000Open the generated URL in your browser — your local app is now online.
Features
🔒 Secure tunnels
All traffic is encrypted end-to-end. Your local server is never directly exposed.
📊 Live dashboard
Monitor every request in real time:
- Request count, methods, paths, status codes
- Response time and bandwidth
- Full request history per tunnel
- Expandable request headers and response body
🔑 Account & history
Link your tunnels to an account to keep permanent history:
- Log in at https://localhostfor.online/login with your WhatsApp (via SMS OTP)
- Get your personal API key
- Run the tunnel with your key:
npx localhostforonline tunnel --port 3000 --api-key lf_sk_xxx
📁 Tunnel history
Every tunnel you create appears in the dashboard.
Click on any tunnel to see its full request log.
👤 Anonymous access
Even without an account, anyone with a tunnel URL can view its request history:
https://localhostfor.online/dashboard?token=<project-id>🌐 Protocol support
| Protocol | How | Example |
|----------|-----|---------|
| HTTP (default) | All methods (GET, POST, PUT, DELETE, etc.) | npx localhostforonline tunnel --port 3000 |
| WebSocket | Auto-detected via Upgrade: websocket header | Same command — no extra flags |
| TCP | Dedicated TCP port for raw byte relay | npx localhostforonline tunnel --port 3000 --tcp |
CLI usage
# HTTP / WebSocket (auto-detected)
npx localhostforonline tunnel --port 3000
# TCP forwarding
npx localhostforonline tunnel --port 22 --tcp
# Link to your account
npx localhostforonline tunnel --port 3000 --api-key lf_sk_xxx
# Rewrite Host header (for virtual hosts)
npx localhostforonline tunnel --port 3000 --host-header rewrite
# Generate an auth token
npx localhostforonline register
# Save your auth token
npx localhostforonline login <token>Options
| Flag | Type | Default | Description |
|------|------|---------|-------------|
| --port | int | — | Local port to expose |
| --url | string | — | Full local URL (alternative to --port) |
| --api-key | string | — | API key to link tunnel to your account |
| --host-header | string | "" | Rewrite Host header (rewrite = set to localhost:<port>) |
| --tcp | bool | false | Enable TCP forwarding (allocates a dedicated port) |
Output format
Tunnel created!
✓ Your URL: https://localhostfor.online/project-abc123
✓ Local: localhost:3000
✓ Dashboard: https://localhostfor.online/dashboard?token=abc123
✓ TCP Port: 20000 (only when using --tcp)
Press Ctrl+C to stopTCP forwarding
When using --tcp, the server allocates a dedicated TCP port. Connect by sending the project ID (36 bytes) first, then your raw data:
# Example: expose SSH
npx localhostforonline tunnel --port 22 --tcp
# In another terminal:
(printf '<project-uuid>'; cat) | nc localhostfor.online 20000Platform
Website
Endpoints:
/— Landing page with documentation and quick start/dashboard— Tunnel list and request history/dashboard?token=<id>— Request log for a specific tunnel/login— Sign in with WhatsApp to get an API key/account— Your account details
Infrastructure
- Server: Go (chi router + gorilla/websocket)
- Database: PostgreSQL
- Tunnels: WebSocket-based reverse proxy
- Auth: WhatsApp OTP (powered by Pilot Status)
License
MIT
