Skip to content

Forward webhooks to localhost

catchbin forward opens a persistent connection to catchbin and re-sends each captured webhook to a target you choose. It replaces a tunnel for local development: the provider talks to your permanent catchbin URL, and the CLI relays events to localhost.

Terminal window
catchbin forward wk_<your-workspace>/stripe-dev localhost:3000

The first argument is the endpoint, written as <workspace-id>/<slug> — the same pair in your endpoint’s URL. The second is the target. For each forwarded event, the CLI prints the response code and latency your local server returned.

The target does not have to be localhost. You can point captured events at a staging server:

Terminal window
catchbin forward wk_<your-workspace>/stripe-dev https://staging.example.com

If no CLI is connected when a webhook arrives, catchbin still captures it. When you start catchbin forward, the queued events are delivered to your target in the order they were received, and then live events continue to stream.

The connection reconnects automatically if it drops. Reconnect notices are written to stderr, so they do not pollute piped event data on stdout.

Add --json to emit one JSON object per forwarded event on stdout, with status lines kept on stderr:

Terminal window
catchbin forward wk_<your-workspace>/stripe-dev localhost:3000 --json | jq '.status'

Press Ctrl+C to stop. The CLI shuts down cleanly and exits with code 7 (signal exit). Other exit codes are listed in the CLI reference — for example, code 6 means the CLI reached catchbin but could not reach your local target.