# Test Webhooks on Localhost with ProxVN (Stripe, Telegram, Payment Gateways)

Payment gateways and bots need a public URL to send callbacks to, but your code lives on localhost. With a fixed ProxVN subdomain you register the webhook URL once and test locally — no deploys.

Source: https://proxvn.io.vn/blog/test-webhooks-on-localhost-proxvn

## The deploy-to-test-webhooks loop is broken

When you integrate a payment gateway (Stripe, or regional ones like MoMo/VNPay/SePay) or a Telegram Bot, you hit the same loop:

1. The provider needs a **public URL** to send callbacks/IPN to.
2. Your code runs on **localhost**.
3. Every code change means **deploying to staging** before you can test — slow and painful.

Free ngrok helps a little, but the **URL changes on every restart**, so you keep re-registering the webhook URL in each provider's dashboard.

The fix: a **fixed subdomain** from ProxVN. Register the webhook URL **once**, then test on localhost as much as you want.

## Step 1: Run your backend and prepare the webhook endpoint

Say your backend runs on port 3000 with an endpoint like:

```
POST /webhook
```

Sanity-check it locally first:

```
curl -X POST http://localhost:3000/webhook -d '{"test":true}'
```

## Step 2: Install ProxVN

**Linux / macOS / Android (Termux):**

```
curl -fsSL https://proxvn.io.vn/install.sh | sh
```

**Windows (PowerShell):**

```
irm https://proxvn.io.vn/install.ps1 | iex
```

## Step 3: Open a tunnel with a fixed subdomain

Create a free account at [https://proxvn.io.vn/](https://proxvn.io.vn/) to get an API key, then run:

```
proxvn http 3000 --subdomain myapp
```

Your webhook URL is:

```
https://myapp.proxvn.io.vn/webhook
```

It **never changes** between runs (a free account includes up to **3 fixed subdomains** and **10 tunnels**), so you register it once per provider.

## Step 4: Register the URL with each provider

- **Stripe / MoMo / VNPay / SePay:** paste the URL into the IPN / Callback / Webhook endpoint field in the provider's partner dashboard.
- **Telegram Bot:** call the ` setWebhook ` API method pointing to the URL above.

One big advantage: with ProxVN, **APIs, webhooks and ` curl ` pass straight through — the safety warning page never blocks them**, even in anonymous mode. The warning only appears for browser visitors without an account, so webhook flows are unaffected. Still, use an account + fixed subdomain so the URL stays stable.

## Step 5: Test for real

Make a test payment on Stripe/your gateway, or send a message to your Telegram Bot. The request lands **directly on your localhost** — set breakpoints, read logs, fix code and retest instantly, with zero deploys.

## Safety notes

- A public webhook endpoint is not a trusted one: **always verify the provider's signature/secret** in your code, exactly as in production.
- **Stop the tunnel after testing** (` Ctrl + C `) — do not leave a test endpoint open overnight.
- Never use real payment data in a test environment.

## Wrap-up

With a fixed ProxVN subdomain, webhook testing goes back to what it should be: change code → test → repeat, all on localhost.

👉 **Get started:** [https://proxvn.io.vn/download](https://proxvn.io.vn/download) — detailed guide: [https://proxvn.io.vn/docs/](https://proxvn.io.vn/docs/)
