Language

Node.js proxy setup

Node 18+ ships fetch, but it ignores HTTP_PROXY by default. Pass an undici ProxyAgent as the dispatcher and every fetch routes through your residential gateway. No axios, no extra HTTP client required.

Get 1 GB of residential data — freeon your first $10+ top-upClaim it

Connection details

proxmint · gateway
Host : Port (HTTP)gw.proxmint.com:823
Host : Port (SOCKS5)gw.proxmint.com:824
UsernamePROXY_USER
PasswordPROXY_PASS

Swap PROXY_USER / PROXY_PASS for the credentials on your dashboard. New here? Create an account to generate a key.

Node.js (fetch) proxy example

javascript
// Node 18+ — native fetch through the proxy via undici
import { ProxyAgent } from "undici";

const agent = new ProxyAgent("http://PROXY_USER:PROXY_PASS@gw.proxmint.com:823");

const res = await fetch("https://api.ipify.org?format=json", { dispatcher: agent });
console.log(await res.json()); // a fresh residential IP

// Country targeting: add __cr.us to the username
const us = new ProxyAgent("http://PROXY_USER__cr.us:PROXY_PASS@gw.proxmint.com:823");
const r2 = await fetch("https://api.ipify.org", { dispatcher: us });
console.log(await r2.text());

Steer the exit IP from the username

append to your username
CountryPROXY_USER__cr.us
Country + cityPROXY_USER__cr.us;city.newyork
Sticky IP (30 min)PROXY_USER__sessid.abc123;sessttl.30

Tips & gotchas

  • undici ships with Node 18+; if you import it explicitly, run npm i undici.
  • Prefer axios? Use the https-proxy-agent package and pass it as httpsAgent.

Node.js (fetch), answered

Why does Node fetch ignore my proxy?

Native fetch does not read HTTP_PROXY env vars. You must pass a dispatcher (undici ProxyAgent) per request, or set a global dispatcher with undici's setGlobalDispatcher.

Does this work with axios or got?

Yes. axios takes an https-proxy-agent as httpsAgent; got accepts an agent option. The same gateway URL works across all of them.

Ready to route Node.js (fetch) through residential IPs?

Create an account, paste the code above, and we'll add your first 1 GB of residential free on your first top-up. Pay by the GB after that — no subscription.