Back to home

How to Forward a Webhook to Localhost

Use a public webhook inbox as the first hop, then replay or forward the event into your local environment safely.

Last updated: 2026-06-24

Most providers cannot reach your localhost directly. The practical pattern is to receive the webhook on a public endpoint first, then replay it into a local tunnel or development environment.

Steps

  1. Receive the webhook in WebhookPilot.
  2. Open a trusted public tunnel to your local app.
  3. Configure a forward rule or replay the event manually.
  4. Inspect both the captured request and the downstream delivery result.

Example

curl -X POST "https://your-domain.com/api/events/evt_123/replay" \
  -H "Content-Type: application/json" \
  -d '{"targetUrl":"https://your-tunnel.example/webhook"}'

Common mistakes

  • Forwarding directly to localhost from a hosted service
  • Not validating the replay target
  • Forgetting to restart the tunnel after the URL changes

FAQ

Can the hosted service call localhost directly?

No. You need a public ingress such as a tunnel or staging URL.

Why keep the public inbox step?

It gives you a durable record, replay controls, and safer debugging.

Pair this with How to replay a webhook request.