This chapter covers the core features and capabilities of Webhook Router.
Follow this guide to get Webhook Router up and running in your environment.
# 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 DEBUGSend a test webhook:
curl -X POST http://localhost:8080/hooks/test \
-H "Content-Type: application/json" \
-d '{"event": "test.ping", "data": {"message": "hello"}}'Create a JSON config file for production setups:
{
"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"
}
]
}| Flag | Default | Description |
|---|---|---|
--config, -c | — | Path to JSON configuration file |
--port, -p | 8080 | Server port |
--host | 0.0.0.0 | Bind address |
--database, -d | — | SQLite database path for event persistence |
--log-file | stderr | Log to file instead of stderr |
--log-level | INFO | Logging level (DEBUG, INFO, WARNING, ERROR) |
| Field | Type | Description |
|---|---|---|
name | string | Route identifier |
path_pattern | string | Regex pattern for URL path matching |
secret | string | HMAC secret for signature verification |
signature_header | string | HTTP header containing the signature |
forward_url | string | URL to forward validated events to |
event_filter | list | Only process these event types |
Get the full Webhook Router and unlock everything.
Get the complete guide with every chapter unlocked, including code samples, diagrams, and best practices.
Access all interactive tools with complete data, all workload profiles, and the full scenario library.
Downloadable source code, configuration files, and working examples from every chapter.
Free updates for life. Every new chapter, tool, and improvement included.