Documentation
localhostforonline is a single-binary CLI you can run via npx.
Install
npm
$ npm install -g localhostforonlinetunnel
Forward a local port to a public HTTPS URL.With a pinned subdomain:
tunnel
$ npx localhostforonline --port 3000tunnel
$ npx localhostforonline --port 3000 --subdomain my-applogin
Authenticate the CLI and store the API key locally.
auth
$ npx localhostforonline loginwhoami
Show the currently authenticated user.
auth
$ npx localhostforonline whoamitunnels
List tunnels from every workspace where you are an active member. Each row identifies its workspace.Use JSON output for scripts and integrations:
tunnels
$ npx localhostforonline tunnelstunnels
$ npx localhostforonline tunnels --jsonsubdomains
List subdomains from every workspace where you are an active member. Each row identifies its workspace.Use JSON output for scripts and integrations:Configure password protection:
subdomains
$ npx localhostforonline subdomainssubdomains
$ npx localhostforonline subdomains --jsonsubdomains
$ npx localhostforonline subdomains auth my-app
npx localhostforonline subdomains auth my-app --user visitor --password secret
npx localhostforonline subdomains auth my-app --offFlags
--port <n>— local port to forward--url <url>— forward to a full URL (e.g. http://localhost:8080)--subdomain <name>— pin a permanent subdomain (requires login)--host-header rewrite— rewrite Host header to localhost:<port>--tcp— enable TCP forwarding--dev— force dev mode (auto-detected for Vite and Next.js)--keep-origin— forward Origin/Referer/Sec-Fetch-* untouched, even in dev modetunnels --json— list every accessible tunnel as JSON, including its workspacesubdomains --json— list every accessible subdomain as JSON, including its workspacesubdomains auth <name> --off— configure or disable password protection