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.
| Flag | Type | Description |
|---|---|---|
-p, --portrequired | number | Local port to expose through the tunnel. |
-h, --host | string | Tunnel server URL to connect to. Defaults to the EZ Tunnel public server. |
-s, --subdomain | string | Request a specific subdomain (4–63 lowercase alphanumeric characters). A random subdomain is assigned if omitted. |
-l, --local-host | string | Hostname to tunnel to instead of localhost. The Host header is rewritten automatically. |
--local-https | boolean | Connect to the local server over HTTPS instead of HTTP. |
--local-cert | string | Path to a TLS certificate file for local HTTPS connections. |
--local-key | string | Path to a TLS key file for local HTTPS connections. |
--local-ca | string | Path to a CA certificate file for local HTTPS connections. |
--allow-invalid-cert | boolean | Skip TLS certificate validation for the local server (useful with self-signed certs). |
-o, --open | boolean | Automatically open the tunnel URL in your default browser. |
--print-requests | boolean | Log 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.