Skip to content
Sections

Webhooks: Stripe, GitHub, and Telegram

Debug Stripe, GitHub, and Telegram webhook handlers on localhost without re-registering URLs after every restart.

NeedsFree$0/moTry an HTTPS tunnel on a shared addressStart free
Webhook sendersHTTPS
HTTPS tunnelshared address · Free
  • localhost:3000
Webhook senders → localhost:3000
On this page10

On the Free plan, each named tunnel keeps a permanent *.prontaro.dev subdomain (up to 40K requests per month). The browser warning page never intercepts webhooks or API clients, so provider POST requests arrive at localhost with original HMAC headers intact, and delivery statuses appear in Prontaro Logs.

Why Prontaro works well for webhooks

Need Free plan (*.prontaro.dev) Tunnels and above (*.prontaro.run)
Permanent HTTPS URL across restarts Yes (assigned subdomain) Yes (custom --url or custom domain)
Webhook delivery without warning page Yes Yes (no warning in browsers either)
Sender IP allowlist (prontaro access) Yes Yes
Receive on your dedicated IPv4 (:443) No Yes (Dedicated / Pro)

Step 1. Start a persistent HTTPS tunnel

Install the prontaro CLI, sign in (prontaro login), and expose your local app port (for example 3000):

prontaro http 3000 --name webhooks
  Tunnel     webhooks                                ● connected
  Address    https://a7f2k9m3.prontaro.dev  →  http://127.0.0.1:3000
  Access     everyone · no password   (as of launch)
  Server     <server> · <region> · 18 ms

The URL stays tied to the webhooks name in your account. When you stop it (Ctrl+C) and run prontaro http 3000 --name webhooks or prontaro run webhooks tomorrow, it comes back at the exact same URL — no need to update webhook settings at the provider.

On Tunnels and higher plans you can pick a readable subdomain (--url my-webhooks → https://my-webhooks.prontaro.run) or attach a custom domain.

Step 2. Register the URL and verify signatures

Never trust an incoming POST request based on URL secrecy alone — always verify the provider’s cryptographic signature or secret token in your handler.

Stripe

Add an endpoint in the Stripe Dashboard:

Stripe DashboardDevelopersWebhooksAdd endpoint
Endpoint URL
https://a7f2k9m3.prontaro.dev/webhooks/stripe
Events
checkout.session.completed, invoice.paid

Copy the signing secret (whsec_...) and verify Stripe-Signature against the raw request body before JSON parsing:

ts
// Express: mount express.raw({ type: 'application/json' }) on this route
import Stripe from 'stripe';

const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!);

app.post('/webhooks/stripe', express.raw({ type: 'application/json' }), (req, res) => {
  const sig = req.headers['stripe-signature'] as string;
  try {
    const event = stripe.webhooks.constructEvent(
      req.body,
      sig,
      process.env.STRIPE_WEBHOOK_SECRET!,
    );
    console.log('Stripe event:', event.type);
    res.sendStatus(200);
  } catch (err) {
    res.status(400).send(`Signature error: ${(err as Error).message}`);
  }
});

GitHub

Create a webhook in your repository or organization settings:

RepositorySettingsWebhooksAdd webhook
Payload URL
https://a7f2k9m3.prontaro.dev/webhooks/github
Content type
application/json
Secret
<GITHUB_WEBHOOK_SECRET>

Verify the X-Hub-Signature-256 HMAC-SHA256 header using constant-time comparison (timingSafeEqual):

ts
import crypto from 'node:crypto';

function verifyGitHubSignature(rawBody: Buffer, header: string | undefined, secret: string) {
  if (!header?.startsWith('sha256=')) return false;
  const expected = 'sha256=' + crypto.createHmac('sha256', secret).update(rawBody).digest('hex');
  const a = Buffer.from(header);
  const b = Buffer.from(expected);
  return a.length === b.length && crypto.timingSafeEqual(a, b);
}

Telegram Bot API

Telegram requires HTTPS on port 443 with a trusted TLS certificate — Prontaro provides both automatically. Register your webhook with a secret_token:

bash
curl -fsS -X POST "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/setWebhook" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://a7f2k9m3.prontaro.dev/webhooks/telegram",
    "secret_token": "'"${TELEGRAM_WEBHOOK_SECRET}"'"
  }'

Telegram includes X-Telegram-Bot-Api-Secret-Token on every incoming request (update) — compare it against TELEGRAM_WEBHOOK_SECRET before processing the payload.

Step 3. Restrict access by sender IP (optional)

On top of signature verification, you can restrict tunnel access to the provider’s published IPv4 CIDR ranges. Rejected requests stop at the Prontaro server before reaching your machine and do not count toward your monthly traffic allowance.

In the dashboard
  1. Open Tunnels, select webhooks, and switch to the Access tab.
  2. Enable IPv4 restrictions and add the provider’s published CIDRs (for example Telegram’s 149.154.160.0/20 and 91.108.4.0/22).
TunnelsAccessOpen in dashboard
In the terminal (CLI)
bash
# Example using Telegram Bot API's published ranges
prontaro access webhooks allow 149.154.160.0/20 91.108.4.0/22

Step 4. Debug deliveries in Logs

Open Logs in the dashboard and filter by the webhooks tunnel.

Entries appear within about 10 seconds and show:

  • sender IP, HTTP method (POST), and path (/webhooks/stripe);
  • your local app’s HTTP status (200, 400, 500) or local delivery errors (502, 504);
  • request duration and bytes transferred;
  • access refusals — if a provider rotates onto a new IP, you can allow it directly from the log row.

Webhook bodies, signature headers, and query strings are never stored in Prontaro Logs — inspect payloads directly in your local app logs.

Common errors

Symptom Cause Fix
400 Invalid signature in Stripe / GitHub Framework parsed JSON before HMAC verification, altering raw bytes. Pass the untouched raw body buffer (express.raw() / req.arrayBuffer()).
403 Forbidden in provider delivery log Provider sent the webhook from a new IP missing from prontaro access. Open Logs in the dashboard, locate the refused IP, and allow it under Access.
502 local_unreachable prontaro http is running, but nothing listens on local port 3000. Start your local server and verify its bind address (127.0.0.1 or 0.0.0.0).
Telegram reports SSL error or timeout Registered http:// instead of https:// or handler took too long to reply. Use https://...prontaro.dev and return 200 OK before slow background work.

Next steps

  • HTTPS tunnels — persistent subdomains, --url names, and running tunnels in the background.
  • Access control & firewalls — restrict incoming requests by sender IP and configure Basic Auth.
  • Custom domains — receive webhooks on your own domain with automatic Let’s Encrypt certificates.
  • Connection logs — log retention, filtering, and delivery debugging.
  • Prontaro vs ngrok — how plans, permanent Free URLs, and webhook features compare.

Contact us

Enter your email so we can reply.Enter a valid email, e.g. name@company.example.
Tell us what you need or what went wrong.up to 2,000 characters

Sent! We’ll reply to .

Or email us at support@prontaro.com