Overview
The Ahh CLI webhook server provides a complete solution for receiving and inspecting HTTP webhooks during development. It automatically creates a local server, tunnels it to the internet, and provides a beautiful web dashboard for viewing incoming requests in real-time.How It Works
When you runahh webhook, the CLI:
- Starts a local Elysia server on the configured port (default: varies by config)
- Creates a Cloudflare tunnel to expose the server publicly
- Generates a secure authentication token
- Opens a web dashboard at
cli.ahh.betfor viewing requests - Streams all incoming HTTP requests to the dashboard via WebSocket
All webhook data is processed locally and streamed only to your authenticated browser session. No data is stored on remote servers.
Basic Usage
Start the Webhook Server
- Start a local webhook server
- Create a public tunnel URL
- Open your browser to the dashboard
Example Output
Architecture
Server Implementation
The webhook server is built on Elysia with WebSocket support:/home/daytona/workspace/source/ahh-binary/src/commands/webhook/main.ts:22-69
Header Filtering
To keep the display clean, certain proxy and CDN headers are filtered out:/home/daytona/workspace/source/ahh-binary/src/commands/webhook/main.ts:6-20
This filters out:
- Cloudflare headers (
cf-*) - Forwarding headers (
x-forwarded-*) - CDN loop detection headers
WebSocket Authentication
The server uses a UUID token for secure WebSocket connections:/home/daytona/workspace/source/ahh-binary/src/commands/webhook/main.ts:50-62
Request Logging
Captured Data
Each incoming request captures:Real-Time Streaming
Requests are broadcast to all connected WebSocket clients:Use Cases
GitHub Webhooks
Test repository events like pushes, pull requests, and issue comments without deploying.
Payment Integration
Debug payment webhooks from Stripe, PayPal, or other payment processors.
API Development
Inspect incoming API requests to understand client behavior and debug issues.
Third-Party Services
Receive webhooks from Twilio, SendGrid, or any other service that sends HTTP callbacks.
Dashboard Features
The web dashboard provides:- Real-time updates: See requests as they arrive
- Request details: View method, path, headers, query params, and body
- Timestamp tracking: Know exactly when each request was received
- Formatted JSON: Pretty-printed JSON bodies for easy reading
- Multiple requests: View and compare multiple requests side-by-side
Advanced Usage
Custom Port Configuration
Configure the default webhook port in your config file:Programmatic Usage
Use the webhook server in your own scripts:Security Considerations
CORS Configuration
The server only allows WebSocket connections from the official dashboard:Token-Based Auth
WebSocket connections require the exact token generated at server startup:Public Exposure
Be aware that:- The webhook URL is publicly accessible
- Anyone with the URL can send requests
- All requests are logged and visible in your dashboard
- Don’t use for sensitive production data
Integration Examples
- GitHub
- Stripe
- Custom Service
- Run
ahh webhook - Copy the webhook URL
- Go to your GitHub repo Settings → Webhooks
- Add webhook with your URL
- Select events you want to receive
- Save and test the webhook
Troubleshooting
Dashboard not opening
Dashboard not opening
The CLI tries to automatically open the dashboard. If it doesn’t work:
- Copy the Webhook URL from the terminal
- Manually visit
https://cli.ahh.bet/webhook - Paste your webhook URL and token when prompted
Requests not appearing
Requests not appearing
Check that:
- The webhook URL is correct and accessible
- Your browser has WebSocket connections enabled
- You’re not behind a firewall blocking WebSockets
- The sender is actually making requests (check sender logs)
WebSocket connection failed
WebSocket connection failed
Ensure:
- You’re using the correct authentication token
- The dashboard domain is
cli.ahh.bet - Your network allows WebSocket connections
Best Practices
- One webhook server at a time - Avoid running multiple instances to prevent port conflicts
- Clean up when done - Stop the server when you’re finished testing
- Verify signatures - When implementing real webhooks, always verify cryptographic signatures
- Use HTTPS - The tunnel provides HTTPS automatically, ensuring secure transmission
- Test error cases - Use the webhook server to test how your code handles malformed or unexpected payloads
Related Commands
- Tunneling - Learn more about the underlying tunnel technology
- File Serving - Serve static files with similar tunneling
Technical Reference
Return Value
ThecreateWebhookServer function returns:
Dependencies
- Elysia: Fast web framework
- @elysiajs/cors: CORS middleware
- WebSocket: For real-time request streaming
- Cloudflare tunnel: For public URL generation
