listen Command

Last updated October 18, 20264 min read

Forward webhooks to localhost without changing the provider URL

To forward webhooks to localhost from the command line without changing your provider's URL, point the provider at a hosted Hooklistener endpoint and run hooklistener listen YOUR_ENDPOINT_SLUG --target http://localhost:3000, replacing YOUR_ENDPOINT_SLUG with the endpoint's slug from your dashboard. The CLI forwards each captured request to your local server, and requests that arrive while you're offline stay in history for replay.

terminal
npm i -g hooklistener        # or: brew tap hooklistener/tap && brew install hooklistener
hooklistener login           # one-time browser sign-in
# Replace YOUR_ENDPOINT_SLUG with your endpoint's slug from the dashboard
hooklistener listen YOUR_ENDPOINT_SLUG --target http://localhost:3000
# Each request to your hosted endpoint → http://localhost:3000

The listen command forwards webhooks from an existing Hooklistener endpoint to your local development server. This is perfect for debugging production webhooks locally or replaying events during development.

When to use listen vs tunnel:Use listen when you already have a Hooklistener endpoint configured in your webhook provider. Use tunnel when you need a new public URL to configure.

Usage

hooklistener listen <ENDPOINT_SLUG> --target <URL>

Find Your Endpoint Slug

  1. Create an endpoint in the Hooklistener dashboard (see setting up an endpoint) and paste its URL into your webhook provider.
  2. Copy the endpoint's slug from the dashboard. It looks like stripe-checkout-x7kq.
  3. Replace YOUR_ENDPOINT_SLUG in the commands on this page with that slug, and set --target to the URL your local server listens on.

Arguments and Options

Argument / optionDescription
<ENDPOINT_SLUG>(Required) Slug of the hosted endpoint to listen to
--target <URL>URL to forward each request to, such as http://localhost:3000
--helpShow help information

How It Works

  1. Connect to endpoint: The CLI establishes a WebSocket connection to your Hooklistener endpoint.
  2. Receive webhooks: When a webhook arrives at your endpoint, it's streamed to the CLI in real-time.
  3. Forward locally: The CLI makes an HTTP request to your local server with the same method, headers, and body.
  4. Return response: Your local server's response is captured and logged.

Examples

Basic Usage

Forward webhooks from your endpoint to localhost:3000:

hooklistener listen YOUR_ENDPOINT_SLUG --target http://localhost:3000

Target Your Webhook Route

Include the path of your webhook handler in the target URL:

hooklistener listen YOUR_ENDPOINT_SLUG --target http://localhost:3000/api/webhooks

Custom Host

Forward to a different host (e.g., Docker container):

hooklistener listen YOUR_ENDPOINT_SLUG --target http://192.168.1.100:3000

Checked September 2026

Hooklistener vs ngrok http vs hookdeck listen

All four commands forward webhooks to a local port. They differ in which URL the provider sees and what happens to a request after it arrives.

CLI commands for forwarding webhooks to localhost, compared as of September 2026
Criteriahooklistener tunnelhooklistener listenngrok httphookdeck listen
Commandhooklistener tunnel --port 3000hooklistener listen YOUR_ENDPOINT_SLUG --target http://localhost:3000ngrok http 3000hookdeck listen 3000 <source>
URL you give the providerRandom hook.events subdomain on Free; a static subdomain on paid plansYour hosted endpoint URL, which doesn't change, on Free too1 static dev domain on FreeA permanent event URL per source
When your machine is offlineRequests aren't delivered while the tunnel is closedThe endpoint still captures requests; replay them laterRequests aren't delivered while the agent is stoppedNot documented
History and replayStored in the cloud: 1 day on Free, up to 90 days on Scale; replay to localhostStored in the cloud: 1 day on Free, up to 90 days on Scale; replay to localhostTraffic Inspector, 24-hour retention on Free; replay needs opt-in Full CaptureCLI Events page and local retry (not in guest mode)
Free tier1 CLI tunnel at a time, 50 stored requests1 hosted endpoint, 50 stored requests20,000 HTTP requests/mo, 1 GB transfer; interstitial page on HTTP endpointsDeveloper plan: 10,000 events/mo, 3-day retention
Pick it whenYou want a public URL for a local port right nowYou want a provider URL that never changes and no lost webhooksYou also need TCP/TLS tunnels or non-webhook trafficYou already route production events through Hookdeck

Sources: ngrok pricing, ngrok Traffic Inspector, Hookdeck CLI docs, Hookdeck pricing, Hooklistener pricing.

Use Cases

Debug Production Webhooks

Your production webhook endpoint is already configured with services like Stripe or GitHub. Use listen to forward a copy of incoming webhooks to your local machine for debugging without changing the production configuration.

Replay Events

Hooklistener stores recent webhooks. You can replay them through the web dashboard and use listen to receive them locally again.

Team Development

Multiple developers can listen to the same endpoint simultaneously, each forwarding to their own local server.

  • tunnel — Create a new public URL instead of using an existing endpoint
  • tui — Browse endpoints and requests interactively
  • login — Authenticate before using listen