tunnel Command

Last updated January 14, 20264 min read

The tunnel command creates a public HTTPS URL that tunnels all traffic to your local development server. This is the fastest way to test webhooks from services like Stripe, GitHub, Slack, and more.

Most Used Command

This is the most commonly used CLI command. Start your local server, run hooklistener tunnel --port 3000, and you're ready to receive webhooks.

Usage

hooklistener tunnel --port <PORT> [OPTIONS]

Options

OptionDescription
--port <PORT>(Required) Local port to tunnel to
--host <HOST>Local host to tunnel to (default: localhost)
--subdomain <NAME>Request a specific subdomain (requires paid plan)
--scheme <SCHEME>Protocol to use locally: http or https (default: http)
--helpShow help information

How It Works

  1. Establish connection: The CLI opens a secure WebSocket connection to Hooklistener's edge servers.
  2. Get public URL: You receive a unique HTTPS URL (e.g., https://abc123.hook.events).
  3. Receive requests: Any HTTP request to your public URL is streamed to the CLI.
  4. Forward locally: The CLI forwards the request to your local server with all headers and body intact.
  5. Return response: Your server's response is sent back through the tunnel to the original caller.

Security:All traffic is encrypted with TLS. Your local server never needs to be directly exposed to the internet.

Examples

Basic Tunnel

Expose localhost:3000 with a public URL:

hooklistener tunnel --port 3000

Output:

✓ Tunnel established

  Public URL: https://abc123.hook.events
  Forwarding: https://abc123.hook.events → http://localhost:3000

  Ready to receive webhooks. Press Ctrl+C to stop.

Custom Subdomain

Request a memorable subdomain (paid plans):

hooklistener tunnel --port 3000 --subdomain my-app

This gives you https://my-app.hook.events — useful for webhook configurations you don't want to update frequently.

Tunnel to Docker Container

Forward to a service running in Docker:

hooklistener tunnel --port 8080 --host host.docker.internal

Local HTTPS Server

If your local server uses HTTPS:

hooklistener tunnel --port 3000 --scheme https

Common Integrations

Once your tunnel is running, configure these services with your public URL:

  • Stripe: Dashboard → Developers → Webhooks → {tunnel_url}/stripe/webhook
  • GitHub: Repo Settings → Webhooks → {tunnel_url}/github/events
  • Slack: App Settings → Event Subscriptions → {tunnel_url}/slack/events
  • Twilio: Phone Number → Messaging → {tunnel_url}/twilio/sms

Tip:Check out our integration guides for step-by-step instructions: Stripe, GitHub, Slack

Troubleshooting

Connection refused

Make sure your local server is running on the specified port. The tunnel forwards requests, but they'll fail if nothing is listening.

Tunnel disconnects frequently

This usually indicates network instability. Check your internet connection, VPN, or firewall settings. The CLI will attempt to reconnect automatically.

Subdomain already taken

Custom subdomains are first-come, first-served. Choose a different subdomain or upgrade to a plan with reserved subdomains.

  • listen — Forward from an existing endpoint instead of creating a new URL
  • tui — View tunnel traffic in the interactive UI
  • login — Authenticate before creating tunnels