If you're developing webhook integrations locally, you've probably used ngrok or a similar tunneling tool. It's the default recommendation in almost every webhook provider's documentation. But is it always the best approach?
In this post, we'll compare two fundamentally different approaches to local webhook development:
- Tunneling (ngrok, Cloudflare Tunnel, localtunnel) — Exposes your localhost to the internet
- Capture-and-Replay (HookReplay) — Captures webhooks and lets you replay them on demand
Spoiler: they're not mutually exclusive. The best approach depends on what you're trying to do.
How Tunneling Works
Tools like ngrok create a secure tunnel from the public internet to your local machine. When Stripe (or any webhook provider) sends a request to your ngrok URL, it gets forwarded to your localhost.
Stripe --> ngrok.io --> ngrok client --> localhost:3000
Pros:
- Real-time webhook delivery
- Works with any webhook provider
- No code changes needed
- Great for demos and testing with external collaborators
Cons:
- Free tier gives you a new URL on every restart
- You need to re-trigger webhooks every time you want to test
- Can't easily test the same payload multiple times
- Debugging with breakpoints is tricky (webhook times out while you're stepping through code)
- Requires internet connection
How Capture-and-Replay Works
HookReplay takes a different approach. It captures webhooks at a stable URL, stores them for inspection, and gives you two options: real-time forwarding to localhost (just like ngrok) or on-demand replay whenever you want.
Real-time mode (like ngrok): Stripe --> HookReplay --> CLI --> localhost:3000 Or replay later: Stripe --> HookReplay (captures & stores) Later: HookReplay --> CLI --> localhost:3000
Pros:
- Real-time forwarding to localhost (same as ngrok)
- Replay the same webhook as many times as you need
- Debug with breakpoints at your own pace
- Edit payloads to test edge cases
- Stable URL that never changes
- Full history of all webhooks received
Cons:
- Requires CLI to be connected for real-time forwarding
- Smaller ecosystem (newer tool)
When to Use ngrok
Tunneling is the right choice when:
- You need to expose more than just webhooks (full web app, APIs)
- External collaborators need to access your entire local server
- You're testing OAuth callbacks or other redirect flows
- You're already in the ngrok ecosystem with paid features
When to Use HookReplay
HookReplay is the right choice when:
- You're debugging webhook handlers specifically
- You need to replay the same webhook multiple times
- You want to test edge cases by editing payloads
- You need stable URLs without paying for a subscription
- You want real-time forwarding plus replay capability
- You're reproducing a production bug with a specific payload
Side-by-Side Comparison
| Feature | ngrok | HookReplay |
|---|---|---|
| Real-time delivery | Yes | Yes |
| Stable URL (free tier) | No (changes on restart) | Yes |
| Replay same webhook | No (must re-trigger) | Yes (unlimited) |
| Edit payload before sending | No | Yes |
| Breakpoint debugging | Difficult (timeouts) | Easy (you control timing) |
| Webhook history | Limited (paid plans) | Yes (all plans) |
| Works offline | No | Partial (replay cached webhooks) |
| Good for demos | Yes | Yes |
| Good for debugging | Okay | Excellent |
Why HookReplay Does Both
Here's the thing: you shouldn't have to choose between real-time forwarding and replay capability. HookReplay gives you both in one tool:
- Real-time forwarding — When your CLI is connected, webhooks are forwarded to localhost instantly (just like ngrok)
- Capture and store — Every webhook is saved, so you can inspect it later
- Replay on demand — Click replay to send any stored webhook to localhost again
- Edit before replay — Modify payloads to test edge cases
This means you get the best of both worlds without switching tools. Start with real-time forwarding to see what's coming in, then switch to replay mode when you need to debug.
Real-World Workflow
Here's how a typical development session might look:
Day 1: Setting up Stripe integration
You're integrating Stripe payments for the first time. You use ngrok to expose your local server and configure Stripe to send webhooks there. You trigger test payments and see what events arrive.
Day 2: Building the webhook handler
Now you're writing the actual handler code. You switch to HookReplay, capture a
payment_intent.succeeded event, and replay it 50 times while you debug your code.
No need to create 50 test payments.
Week 3: Production bug
A customer reports that their subscription wasn't created after payment. You look at your HookReplay dashboard, find the exact webhook that failed, and replay it locally with breakpoints to find the bug. Fixed in 10 minutes instead of 3 hours.
Pricing Comparison
| Plan | ngrok | HookReplay |
|---|---|---|
| Free | Random URLs, 1 agent, limited requests | 1 endpoint, last 10 requests, 3 trial replays |
| Paid (starting) | $8/month (stable domains) | $29/month (unlimited endpoints, 10k req/day) |
Both tools offer generous free tiers that are suitable for individual developers. The paid tiers become valuable when you need stable URLs, more endpoints, or team features.
Summary
ngrok is a general-purpose tunneling tool. It exposes your entire localhost to the internet, which is great when you need external access to your full development server.
HookReplay is purpose-built for webhook development. It gives you real-time forwarding plus the ability to capture, inspect, edit, and replay webhooks. When your workflow is specifically about webhooks, HookReplay is the more powerful choice.
The key difference: ngrok is a tunnel. HookReplay is a webhook development platform.