CLI — tunnel

Updated May 02, 2026

Usage

splithook tunnel --endpoint <slug> --to <local-address>

Options

Flag Required Default Description
--endpoint Endpoint slug (8 chars, e.g. ab3dkf7z)
--to Local address to forward to (e.g. localhost:3000)
--path-prefix (none) Prepend a path, e.g. /webhooks
--timeout 30s Max wait for local handler response
--token ~/.splithook/credentials.json Tunnel token (overrides stored credentials)

Example

splithook tunnel --endpoint ab3dkf7z --to localhost:3000 --path-prefix /webhooks/stripe

Every webhook to https://splithook.com/e/ab3dkf7z is forwarded to:

POST http://localhost:3000/webhooks/stripe

with all original headers plus:

splithook-delivery-id: dlv_01j3k9...
splithook-endpoint: ab3dkf7z
splithook-attempt: 1

Output

✓ Connected · endpoint ab3dkf7z · forwarding to localhost:3000
  Waiting for webhooks...

→  POST  charge.failed          200   142ms
→  POST  customer.created       200    88ms
→  POST  invoice.payment_failed 503  5001ms  [will retry in 30s]
→  POST  invoice.payment_failed 503  5011ms  [will retry in 5m]

Status codes in red indicate the destination returned an error. Splithook retries according to the destination's retry policy — the CLI prints each attempt.

Reconnection

If the Mercure connection drops (network interruption, server restart), the CLI reconnects automatically with exponential backoff. Events received during the disconnection window are not replayed automatically — use the dashboard Replay Log to identify and replay any missed events.

Running multiple tunnels

Run one CLI process per destination:

# Terminal 1 — your API
splithook tunnel --endpoint ab3dkf7z --to localhost:3000

# Terminal 2 — your background worker
splithook tunnel --endpoint ab3dkf7z --to localhost:3001 --path-prefix /internal

Each process uses its own tunnel token (created from the same destination or a different destination on the same endpoint).