Static IP for Vercel
Reach allowlisted payment gateways, partner APIs, and databases from a single fixed IPv4 without leaving Vercel.
First payment refunded within 7 days if it doesn’t work for you
- Partner API
- Database
On this page14
By default, Vercel sends outbound traffic from ephemeral addresses that shift across deployments and regions. With Prontaro, you route only the calls that require a fixed IP: Node.js Functions use HTTPS proxy or SOCKS5, while Edge Runtime connects through a Relay URL.
Which method to choose
Pick the method based on your Vercel runtime and destination:
| Vercel runtime | Prontaro method | End-to-end TLS / mTLS | Best for |
|---|---|---|---|
| Node.js Functions | HTTPS proxy (undici ProxyAgent) |
Yes (HTTP CONNECT) | REST/GraphQL APIs, multiple hosts, mTLS |
| Edge Runtime / Middleware | Relay URL | No (TLS terminated on Prontaro server) | Edge routes without direct TCP sockets |
| Node.js Functions → DB | SOCKS5 (socks5h://) |
Yes (driver TLS) | MongoDB Atlas, PostgreSQL, other TCP databases |
If a partner requires end-to-end TLS or mTLS, run that call in a Node.js Function over HTTPS proxy — see Relay URLs for details.
Prerequisites
- A Prontaro account on Dedicated or Pro (plans).
- A dedicated IPv4: open my.prontaro.com/ips, pick a location near your Vercel region, and click Add IP (assigned when you pick a location, not at checkout).
- A Vercel project running Node.js 20+ (for Functions) or Edge Runtime.
- You do not need
prontaro CLIfor Vercel — create proxy credentials and Relay URLs directly in the dashboard.
Step 1. Create credentials and allowlist your IP
Add your dedicated Prontaro IPv4 (/32) to the partner API or database IP allowlist.
Path A. Proxy credentials for Node.js Functions
- Open IP addresses in my.prontaro.com, select your IP, and click Create proxy credentials.
- Name the credential set (for example,
vercel-prod) and copy theHTTPSURL (https://u_vercel:s3cr3t@<entry>.prontaro.io:443).
Wait until Step 5 before locking down the To destination list so the api.ipify.org check in Step 4 succeeds.
Path B. Relay URL for Edge Runtime and Middleware
- Open IP addresses in my.prontaro.com, select your IP, and click Add relay address.
- Enter the target host
api.example.comand copy the generated URL (https://relay-3f9c2a7e-5b1d-4c8a-9e60-1d2b3c4d5e6f.prontaro.run). - Optionally open the Relay’s Access tab and add a password — the dashboard gives you a
Prontaro-Relay-Authheader so it never collides with the upstreamAuthorizationheader.
Step 2. Add Environment Variables in Vercel
Store the credentials in the Vercel dashboard (or via vercel env add PRONTARO_PROXY_URL production). Turn on Sensitive to hide the value in the UI after saving, and select the target environments (Production, Preview, Development).
- PRONTARO_PROXY_URL
- https://u_vercel:s3cr3t@<entry>.prontaro.io:443
- PRONTARO_RELAY_URL
- https://relay-3f9c2a7e-5b1d-4c8a-9e60-1d2b3c4d5e6f.prontaro.run
- Separate Production and Preview: create a second credential set (
vercel-preview) for Preview deployments so revoking or editing Preview rules never affects Production. - Redeploy after saving: Vercel injects new environment variables only into fresh deployments.
Step 3. Send requests through your static IP
The examples below use standard framework-agnostic Vercel Functions (api/*.mjs). The same ProxyAgent and fetch pattern works in Next.js App Router (app/api/.../route.ts), Pages Router, Astro, Nuxt, and SvelteKit.
Node.js Functions (undici)
Install undici:
npm install undiciInstantiate ProxyAgent once at module scope so reused containers keep connections open:
// api/partner.mjs
import { fetch, ProxyAgent } from 'undici';
const proxyUrl = process.env.PRONTARO_PROXY_URL;
const proxyAgent = proxyUrl ? new ProxyAgent(proxyUrl) : null;
export default async function handler(req, res) {
if (!proxyAgent) {
return res.status(500).json({ error: 'PRONTARO_PROXY_URL is not configured' });
}
const upstream = await fetch('https://api.example.com/v1/status', {
method: 'GET',
dispatcher: proxyAgent,
headers: {
Authorization: `Bearer ${process.env.PARTNER_API_TOKEN}`,
},
signal: AbortSignal.timeout(15_000),
});
const body = await upstream.text();
res.status(upstream.status);
res.setHeader('content-type', upstream.headers.get('content-type') ?? 'application/json');
return res.send(body);
}Edge Runtime and Middleware (Relay URL)
Edge Runtime cannot open direct TCP sockets or HTTP CONNECT tunnels, so pass your Relay URL as the base URL to built-in fetch():
// api/edge-partner.mjs
export const config = { runtime: 'edge' };
export default async function handler() {
const relayBase = process.env.PRONTARO_RELAY_URL;
if (!relayBase) {
return Response.json({ error: 'PRONTARO_RELAY_URL is not configured' }, { status: 500 });
}
const headers = {
Authorization: `Bearer ${process.env.PARTNER_API_TOKEN}`,
// If you enabled a Relay password:
// 'Prontaro-Relay-Auth': process.env.PRONTARO_RELAY_AUTH,
};
const upstream = await fetch(new URL('/v1/status', relayBase), {
method: 'GET',
headers,
signal: AbortSignal.timeout(15_000),
});
return new Response(await upstream.text(), {
status: upstream.status,
headers: { 'content-type': upstream.headers.get('content-type') ?? 'application/json' },
});
}Step 4. Verify the outbound IP
Add a temporary route that calls https://api.ipify.org?format=json:
- For Node.js Functions (using
PRONTARO_PROXY_URL):
// api/egress-check.mjs (remove after verifying)
import { fetch, ProxyAgent } from 'undici';
const proxyAgent = new ProxyAgent(process.env.PRONTARO_PROXY_URL);
export default async function handler(req, res) {
const r = await fetch('https://api.ipify.org?format=json', {
dispatcher: proxyAgent,
signal: AbortSignal.timeout(10_000),
});
return res.status(r.status).json(await r.json());
}- For Edge Runtime: create a temporary Relay for
api.ipify.org, save it inPRONTARO_TEST_RELAY_URL, callfetch(process.env.PRONTARO_TEST_RELAY_URL), and delete that Relay afterwards in the dashboard.
Deploy and invoke the test route:
curl -fsS https://your-project.vercel.app/api/egress-check
{"ip":"203.0.113.10"}Confirm the address matches your IPv4 in my.prontaro.com/ips, then delete api/egress-check.mjs.
Step 5. Lock down allowed targets (recommended)
Once verified, restrict your proxy credentials to the exact destination host and port so leaked credentials cannot reach anything else:
- Open IP addresses → Proxy credentials in my.prontaro.com, select
vercel-prod, and switch to Access. - Add
api.example.com:443under To and save.
Vercel notes and limits
- Keep
ProxyAgentat module scope. Creatingnew ProxyAgent(...)inside the handler disables keep-alive and exhausts sockets under traffic spikes. - Match regions. Check your region in Project → Settings → Functions → Function Region and pick the closest available Prontaro location in the dashboard.
- Keep timeouts below
maxDuration. SetAbortSignal.timeout(...)shorter than your FunctionmaxDurationso slow upstream APIs return a clean error instead of a hard platform timeout.
Common errors
| Error | Cause | Fix |
|---|---|---|
The edge runtime does not support Node.js 'net' module |
undici ProxyAgent imported in a route with runtime = 'edge'. |
Switch to a Relay URL, or remove runtime = 'edge' to run on Node.js Functions. |
PRONTARO_PROXY_URL is not configured on Preview |
Variable enabled only for Production, or not redeployed after saving. | Enable the variable for Preview (with separate proxy credentials) and trigger a redeploy. |
Function hits Vercel timeout (504) |
Upstream call takes longer than maxDuration. |
Set AbortSignal.timeout(...) below maxDuration and make sure your Prontaro location is close to your Vercel Function region. |
For proxy authentication and target errors (407, 403, connection failures), see error codes and HTTP & SOCKS5 proxy.
Next steps
- Connect to MongoDB Atlas — reach a MongoDB Atlas cluster over SOCKS5 with a static IPv4.
- Relay URLs — how Relay URLs work, password protection, and Edge Runtime limits.
- HTTP & SOCKS5 proxy — HTTPS and SOCKS5 proxy setup and allowed destination rules.
- Reliability, zero-downtime updates, and BGP failover — how your
/32stays intact during server failover.
Related guides
- Connect to MongoDB AtlasReplace 0.0.0.0/0 in MongoDB Atlas Network Access with one dedicated Prontaro IPv4 and connect via SOCKS5 or prontaro forward.
- Relay URLsCall IP-allowlisted HTTPS APIs from edge runtimes and no-code tools without proxy configuration by replacing the base URL with a Prontaro Relay URL.
- HTTP & SOCKS5 proxyRoute outbound HTTP, HTTPS, and TCP connections through your static IPv4 with one proxy credential set, end-to-end TLS, and From/To rules.
- Reliability, zero-downtime updates, and BGP failoverHow Prontaro keeps your static IPv4 and tunnels steady in production: AS403244 BGP routing, zero-downtime updates, and automatic standby failover.
Something wrong on this page? Contact us