localtunnel

Node.js CLI and API that exposes a local port at a public URL through a tunnel server, for testing webhooks and sharing local work without DNS or deployment.

install

localtunnel is a tunneling tool that exposes a local port to the internet. The lt command connects to a tunnel server, sets up the tunnel, and prints a public URL that stays active for the length of the session. You don't need to configure DNS or deploy anything. Typical uses are testing with browser tools such as browserling and receiving callbacks from external services such as twilio, which need a public URL.

The CLI is started with lt --port 8000, or with npx localtunnel --port 8000 without a global install. --subdomain requests a named subdomain, and the default is random characters. --local-host proxies to a hostname other than localhost. Arguments can also be set through environment variables, for example PORT=3000 lt. If you restart your local server, lt detects this and reconnects once the server is back.

localtunnel can also be used as a Node.js library. localtunnel({ port: 3000 }) returns a Promise that resolves once a public URL is assigned, and a callback form is kept for backwards compatibility. Options cover the subdomain request, the upstream proxy host (default https://localtunnel.me), local_host (which also rewrites the Host header), and local HTTPS settings: local_https, local_cert, local_key, local_ca, and allow_invalid_cert. The returned tunnel object emits request, error, and close events and has a close method. This suits test integration and automation scripts.

The README lists clients in other languages: gotunnelme and go-localtunnel for Go, localtunnel-client for C#/.NET, and rlt for Rust. The server component is in the separate localtunnel/server repository. The tool is aimed at web and API developers who need to show or test a local service from outside their network.

Installation

# via Homebrew
brew install localtunnel
# via npm
npm install -g localtunnel

Alternatives & related tools

add a badge to your README

Maintain localtunnel? Show that it's featured on trmn. The badge links back to this page.

Featured on trmn
Markdown
[![Featured on trmn](https://www.trmn.sh/badge/localtunnel.svg)](https://www.trmn.sh/tools/localtunnel?utm_source=badge)
HTML
<a href="https://www.trmn.sh/tools/localtunnel?utm_source=badge"><img src="https://www.trmn.sh/badge/localtunnel.svg" alt="Featured on trmn" height="20"></a>