运行正常
这是一个部署在 Cloudflare Pages 上的 NAT 映射服务,用于动态更新和查询 NAT 穿透后的公网地址。
POST /api/update
更新应用的公网 IP 和端口映射。
curl -X POST https://your-domain.pages.dev/api/update \
-H "Content-Type: application/json" \
-H "X-API-Key: your-api-key" \
-d '{
"app": "vpn",
"ip": "1.2.3.4",
"port": 12345,
"proto": "tcp",
"local_ip": "192.168.1.100",
"local_port": 9001
}'
GET /api/get?tenant=companyA&app=vpn
查询指定租户和应用的最新公网地址。
curl https://your-domain.pages.dev/api/get?tenant=companyA&app=vpn
GET /api/test
简单的健康检查端点。
curl https://your-domain.pages.dev/api/test