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 whoamiFlags
--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 Next.js)