Documentation

CLI reference for EZ Tunnel.

Installation

Install the CLI globally with npm:

$ npm install -g eztunnel

Or run directly with npx — no install needed:

$ npx eztunnel --port 3000

Quick Start

Start your local dev server, then run:

$ eztunnel --port 3000

You'll receive a public HTTPS URL like https://abc123.eztunnel.dev that forwards all traffic to your local server. The tunnel stays open until you press Ctrl+C.

CLI Reference

All available flags for the eztunnel command.

FlagDescription
-p, --portrequiredLocal port to expose through the tunnel.
-h, --hostTunnel server URL to connect to. Defaults to the EZ Tunnel public server.
-s, --subdomainRequest a specific subdomain (4–63 lowercase alphanumeric characters). A random subdomain is assigned if omitted.
-l, --local-hostHostname to tunnel to instead of localhost. The Host header is rewritten automatically.
--local-httpsConnect to the local server over HTTPS instead of HTTP.
--local-certPath to a TLS certificate file for local HTTPS connections.
--local-keyPath to a TLS key file for local HTTPS connections.
--local-caPath to a CA certificate file for local HTTPS connections.
--allow-invalid-certSkip TLS certificate validation for the local server (useful with self-signed certs).
-o, --openAutomatically open the tunnel URL in your default browser.
--print-requestsLog every request that passes through the tunnel to the terminal.

Examples

Expose a local dev server

$ eztunnel --port 3000

Creates a tunnel to localhost:3000 with a random subdomain.

Use a custom subdomain

$ eztunnel --port 8080 --subdomain my-app

Your tunnel is available at https://my-app.eztunnel.dev.

Tunnel to a local HTTPS server

$ eztunnel --port 443 --local-https --allow-invalid-cert

Forwards to a local HTTPS server, skipping certificate validation.

Monitor incoming requests

$ eztunnel --port 3000 --print-requests

Prints method, path, status code, and latency for every request.

Open in browser automatically

$ eztunnel --port 3000 --open

Starts the tunnel and opens the public URL in your default browser.