Local Webhook Testing — ngrok, Cloudflare Tunnel, HookDeploy, and VS Code
Compare ngrok, Cloudflare Tunnel, HookDeploy forwarding, and VS Code port forwarding for getting webhooks to your local dev server.
HookDeploy Team · May 22, 2026
Your webhook handler runs on localhost:3000. Stripe runs on the internet. Something has to bridge the gap. Here are four approaches, when to use each, and how they work with HookDeploy.
The four approaches
| Approach | How it works | Local server required? |
|---|---|---|
| ngrok | Tunnel from public HTTPS URL to localhost | Yes, while tunneling |
| Cloudflare Tunnel | Cloudflare edge proxies to local service | Yes, while tunneling |
| HookDeploy forwarding | Capture at HookDeploy URL, proxy to your server | Only when forwarding |
| VS Code port forwarding | Dev tunnel from VS Code to localhost | Yes, while VS Code runs |
ngrok
The most popular option. ngrok runs a local agent that creates a public URL:
ngrok http 3000
# Forwarding: https://abc123.ngrok.io -> http://localhost:3000
Point your webhook sender at https://abc123.ngrok.io/webhooks/stripe. Traffic hits your local server live.
Pros: Live debugging, works with breakpoints, supports TCP/TLS tunnels Cons: URL changes on free tier, agent must stay running, session expires
With HookDeploy: Set HookDeploy forward URL to your ngrok URL. Capture history in HookDeploy plus live processing on localhost.
Cloudflare Tunnel
Cloudflare’s cloudflared daemon creates a tunnel without opening ports:
cloudflared tunnel --url http://localhost:3000
# Creates a random *.trycloudflare.com URL
For persistent URLs, configure a named tunnel with a Cloudflare domain.
Pros: No port forwarding on router, free tier available, integrates with Cloudflare ecosystem Cons: Setup more complex than ngrok for named tunnels, requires cloudflared running
With HookDeploy: Same pattern as ngrok — forward from HookDeploy to your trycloudflare.com URL.
HookDeploy forwarding
Skip the tunnel entirely during capture. Point the webhook sender at HookDeploy:
Stripe → https://hookdeploy.dev/h/abc123 → HookDeploy stores payload
When your local server is ready, either:
- Auto-forward — set forward URL to your tunnel URL. Every webhook is captured and proxied live.
- Manual replay — click Replay in the dashboard to send a captured request to localhost.
# Your server doesn't need to be running when the webhook arrives
# Inspect in HookDeploy, then replay when ready:
# Replay target: https://abc123.ngrok.io/webhooks/stripe
Pros: Capture without local server, persistent history, team sharing, replay on demand Cons: Forward/replay adds latency, not live debugging unless combined with a tunnel
VS Code port forwarding
VS Code (and GitHub Codespaces) can expose local ports via dev tunnels:
- Run your server on port 3000
- Open Ports tab in VS Code
- Set visibility to Public
- Copy the forwarded URL
Pros: Built into your editor, no extra install, works in Codespaces Cons: Tied to VS Code session, less configurable than ngrok, not ideal for team sharing
Comparison table
| ngrok | Cloudflare Tunnel | HookDeploy | VS Code | |
|---|---|---|---|---|
| Setup time | 1 min | 2–5 min | 30 sec | 1 min |
| Persistent URL | Paid | Named tunnel | Always | Session only |
| Capture without local server | No | No | Yes | No |
| Request history | Limited | No | Yes | No |
| Team sharing | No | No | Yes | No |
| Replay | No | No | Yes | No |
| Live debugging | Yes | Yes | With forward | Yes |
| Free tier | Yes | Yes | Yes | Yes |
Recommended workflows
Solo dev, quick test: HookDeploy only. Capture, inspect, replay to localhost when ready.
Active handler development: ngrok + HookDeploy. Forward URL set to ngrok. Live debugging plus history.
CI/CD pipeline: HookDeploy REST API only. No tunnel needed — verify capture programmatically.
Codespaces / remote dev: VS Code port forwarding for live traffic, HookDeploy for capture and replay.
Example: HookDeploy + ngrok together
# Terminal 1
ngrok http 3000
# Terminal 2
npm run dev
# In HookDeploy dashboard:
# 1. Create endpoint → https://hookdeploy.dev/h/abc123
# 2. Set forward URL → https://YOUR-NGROK.ngrok.io/webhooks/stripe
# 3. Point Stripe at HookDeploy URL
Flow: Stripe → HookDeploy (capture) → ngrok → localhost (your handler).
If ngrok goes down, webhooks are still captured in HookDeploy. Replay them when the tunnel is back.
Related guides
Related guides
- Testing Stripe webhooks with HookDeploy
Complete guide to capturing, inspecting, and debugging Stripe webhook events using HookDeploy, the Stripe CLI, and signature verification.
- Webhook debugging guide
Systematic approach to debugging webhook issues — delivery logs, signatures, payloads, curl testing, and common HTTP error codes.
- CI/CD webhook testing with the HookDeploy API
Use the HookDeploy REST API in CI/CD pipelines to create endpoints, send test webhooks, verify capture, and clean up — with a GitHub Actions example.