On this page
Webhook inboxes
An inbox is a stable public URL owned by a team, for example https://acme-stripe.tunnex.org. Point a
provider at it once. Tunnex stores every request, verifies the provider's signature, answers the provider
immediately and delivers a copy to every developer, CI job or staging service that is listening — including
the events they missed while they were offline.
Stripe ──▶ acme-stripe.tunnex.org ──▶ store ──▶ ack 200 to Stripe
│
┌──────────────────┼──────────────────┐
▼ ▼ ▼
alice: tunnex listen bob (offline: gets it staging: tunnex start
→ localhost:3000 when he reconnects) → http://app:3000
Create an inbox
You need an account (tunnex login) and a team. The first inbox creates a personal team if you have none.
tunnex teams create acme
tunnex inboxes create acme-stripe --team acme --provider stripe --secret whsec_...
# → https://acme-stripe.tunnex.org
Then set https://acme-stripe.tunnex.org/<any path> as the webhook URL in the provider's dashboard. The path
and query are kept and forwarded, so /webhooks/stripe arrives at your app as /webhooks/stripe.
Options (tunnex inboxes create --help, tunnex inboxes update --help, or the console):
| Setting | Default | Meaning |
|---|---|---|
--provider |
none |
Signature scheme checked at the edge: stripe, github, slack, shopify, standard, telegram, none. |
--secret |
— | The provider's signing secret. Stored encrypted (AES-GCM with a key derived from the server secret); never shown again. |
--accept-invalid |
reject | By default an event with a bad signature gets 401 and is stored but not delivered. With this flag it is delivered too, marked x-tunnex-verified: false. |
--retention |
7 days | How long events are kept (up to the server's webhooks.max_retention_days, 30 by default). |
--allow-ip |
anyone | Only accept events from these addresses or CIDR ranges (repeatable). |
| acknowledgement | 200 {"ok":true} |
Status (200, 201, 202 or 204), body and content type returned to the provider — set through the API or console. |
Server limits apply to every inbox: 1 MiB per event (webhooks.max_body_bytes), 600 events per minute per
inbox, 10 inboxes per team, 50 subscriptions per inbox (see configuration).
Signature verification
| Provider | Header checked | Timestamped | Notes |
|---|---|---|---|
stripe |
Stripe-Signature (t=…,v1=…) |
yes | 5-minute tolerance, any of several v1 values may match. |
github |
X-Hub-Signature-256 |
no | HMAC-SHA256 of the body. |
slack |
X-Slack-Signature + X-Slack-Request-Timestamp |
yes | Slack's url_verification challenge is answered automatically and not delivered. |
shopify |
X-Shopify-Hmac-Sha256 |
no | Base64 HMAC-SHA256. |
standard |
webhook-id, webhook-timestamp, webhook-signature (or the svix-* names) |
yes | Standard Webhooks: Svix, Clerk, Resend, Liveblocks and others. whsec_ secrets are decoded. |
telegram |
X-Telegram-Bot-Api-Secret-Token |
no | Compares the secret_token you passed to setWebhook. |
none |
— | — | Nothing is checked (x-tunnex-verified: unknown). |
Every delivery carries the result in x-tunnex-verified: true | false | unknown; an inbox with a provider
but no secret reports unknown.
Listen
tunnex listen acme-stripe --forward 3000
tunnex listen acme-github --forward http://localhost:8000/hooks --filter header.x-github-event=pull_request
tunnex listen acme-stripe acme-github --forward 3000 # several inboxes, one connection
--forward takes a port, host:port or URL; the event's own path is appended to the URL path. Each listener
has a name (default: the host name). The server keeps one subscription per (user, inbox, name) with its
own cursor, filters and delivery log — so alice's laptop and alice's CI job are independent, and every
listener gets every matching event (fan-out, not load-balancing).
Deliveries look exactly like the original request (method, path, query, headers, body) plus:
| Header | Value |
|---|---|
x-tunnex-inbox |
the inbox subdomain |
x-tunnex-event-id |
the stored event id (use it for idempotency) |
x-tunnex-delivery |
live, catchup or replay |
x-tunnex-verified |
true, false or unknown |
Deliveries to one listener are sequential, in event order. The cursor moves only after your app answered (any
status), so delivery is at least once. If your app is down (connection refused), the delivery is retried
with backoff (1 s, 2 s, 5 s, 10 s, 30 s) while the listener stays connected; restarting your app does not lose
events. Each attempt is recorded and visible in the console, tunnex inboxes event, and the local inspector.
Where a listener starts
--from decides what a listener receives when it connects:
--from |
Starts after |
|---|---|
cursor (default) |
the last event this subscription received; a brand-new subscription starts now |
now |
the newest event: skip the backlog |
30m, 6h, 2d |
events received in that window |
| an event id | that event |
Catch-up is bounded by the inbox's retention and by webhooks.max_catchup (1000 events by default).
Filters
A listener receives only events matching all of its --filter expressions (up to 10):
| Expression | Matches when |
|---|---|
json.type=checkout.session.completed |
a JSON body field equals the value (json.data.object.id, array indices allowed: json.items.0.sku) |
header.x-github-event=push |
a request header equals the value (name is case-insensitive) |
path^=/webhooks/ |
the path starts with the value |
query.topic*=orders |
a query parameter contains the value |
method=POST |
the HTTP method (case-insensitive) |
json.livemode!=true |
the field differs or is missing |
header.x-shopify-test? |
the field exists |
JSON values compare as their JSON text without quotes for strings: true, null, 42, invoice.paid.
History and replay
tunnex inboxes events acme-stripe # recent events, signature status, deliveries
tunnex inboxes event acme-stripe 1042 # headers, body and every delivery attempt
tunnex inboxes replay acme-stripe 1042 # deliver again to your listeners
tunnex inboxes listeners acme-stripe # subscriptions, cursors, filters, online state
Replays do not move cursors. Members replay to their own listeners; admins can replay to any listener of the
team (--subscription).
Re-signing. Stripe, Slack and Standard Webhooks signatures include a timestamp and expire after 5 minutes,
so a replayed (or caught-up) event would fail your handler's verification. For these providers Tunnex
re-signs events older than 2.5 minutes with the inbox secret and a fresh timestamp before delivering them; the
delivery is marked resigned in the log. Your handler keeps verifying signatures with the same secret.
Schemes without a timestamp (GitHub, Shopify, Telegram) are delivered with their original headers.
Teams and access
| Role | Can |
|---|---|
| member | see the team's inboxes, events and members; listen; replay to own listeners |
| admin | + create, change and delete inboxes and secrets; invite and remove members; replay to any listener; read the audit log |
| owner | + change roles (including other owners), delete the team |
Invite with tunnex teams invite acme --role member (a one-time link valid for 7 days) and accept with
tunnex teams join <link> or in the console. A team always keeps at least one owner.
Tokens for CI and servers. Create a token that can only listen, and let it expire:
tunnex tokens create staging-listener --scope listen --expires-in 90
Scopes: tunnels, listen, inboxes:read, inboxes:write, account. Revoking a token disconnects every
client using it immediately. Every change to teams, members, inboxes, secrets and tokens is recorded in the
audit log (console → Audit, or GET /api/v1/audit).
Headless: Docker, Compose, Kubernetes, CI
tunnex start runs the listeners (and tunnels) of a tunnex.yaml; the token comes from TUNNEX_TOKEN:
listeners:
stripe:
inbox: acme-stripe
forward: http://app:3000
filters: ["json.livemode=false"]
name: staging
Ready-to-run examples: Docker Compose sidecar, Kubernetes sidecar, GitLab CI, GitHub Actions. The file format is in Configuration.
Coding agents (MCP)
tunnex mcp serve gives an agent the inbox tools list_inboxes, start_listener, list_webhook_events,
get_webhook_event, wait_for_webhook and replay_webhook, next to the tunnel and request tools. The loop
"wait for the next Stripe event → read the 500 → fix the handler → replay → 200" runs without a human.
claude mcp add -s user tunnex -- uvx tunnex mcp serve
Data and privacy
Events (headers and bodies) are stored in the server's database until their retention expires; a sweeper
deletes them hourly. X-Forwarded-For and X-Real-IP are not stored; the client IP is. Signing secrets are
encrypted at rest. On a self-hosted server nothing leaves your infrastructure — see
self-hosting for backups.