Contents

Chapter 1

Features

This chapter covers the core features and capabilities of Webhook Router.

Features

  • URL-based routing — Pattern-match incoming webhook paths to specific handlers
  • HMAC signature verification — Validate webhook authenticity (Stripe, GitHub, etc.)
  • Payload validation — JSON schema-style checks on incoming payloads
  • Event filtering — Route based on event type headers or payload fields
  • Retry with backoff — Forward events to downstream URLs with exponential backoff
  • Event persistence — Log all events to SQLite for audit and replay
  • Configurable via JSON — Define routes, secrets, and forwarding targets in a config file
  • Request logging — Structured logging of every incoming request

Requirements

  • Python 3.10+
  • No external dependencies (stdlib only)
Chapter 2

Quick Start

Follow this guide to get Webhook Router up and running in your environment.

Quick Start

bash
# Start the router with default catch-all route on port 8080
python src/webhook_router.py

# Start with a config file
python src/webhook_router.py --config examples/webhook_config.json

# Custom port and logging
python src/webhook_router.py --port 9000 --log-file webhooks.log --log-level DEBUG

Send a test webhook:

bash
curl -X POST http://localhost:8080/hooks/test \
  -H "Content-Type: application/json" \
  -d '{"event": "test.ping", "data": {"message": "hello"}}'

Configuration Reference

Create a JSON config file for production setups:

json
{
    "port": 8080,
    "host": "0.0.0.0",
    "database": "webhooks.db",
    "routes": [
        {
            "name": "stripe-payments",
            "path_pattern": "/hooks/stripe",
            "secret": "whsec_YOUR_STRIPE_WEBHOOK_SECRET",
            "signature_header": "Stripe-Signature",
            "forward_url": "https://api.example.com/v1/payment-events",
            "event_filter": ["charge.succeeded", "invoice.paid"]
        },
        {
            "name": "github-pushes",
            "path_pattern": "/hooks/github",
            "secret": "YOUR_GITHUB_WEBHOOK_SECRET",
            "signature_header": "X-Hub-Signature-256",
            "forward_url": "https://api.example.com/v1/deploy-trigger"
        }
    ]
}

CLI Options

FlagDefaultDescription
--config, -c—Path to JSON configuration file
--port, -p8080Server port
--host0.0.0.0Bind address
--database, -d—SQLite database path for event persistence
--log-filestderrLog to file instead of stderr
--log-levelINFOLogging level (DEBUG, INFO, WARNING, ERROR)

Route Options

FieldTypeDescription
namestringRoute identifier
path_patternstringRegex pattern for URL path matching
secretstringHMAC secret for signature verification
signature_headerstringHTTP header containing the signature
forward_urlstringURL to forward validated events to
event_filterlistOnly process these event types
Chapter 3
🔒 Available in full product

FAQ

You’ve reached the end of the free preview

Get the full Webhook Router and unlock everything.

All Chapters

Get the complete guide with every chapter unlocked, including code samples, diagrams, and best practices.

Full Tool Suite

Access all interactive tools with complete data, all workload profiles, and the full scenario library.

Source Files

Downloadable source code, configuration files, and working examples from every chapter.

Lifetime Updates

Free updates for life. Every new chapter, tool, and improvement included.

Buy Now — $19 →
📦 Free sample included — download another copy for the full product.
Webhook Router v1.0.0 — Free Preview