Node fetch / axios
For plain HTTP calls in Node (without a headless browser), two stacks dominate.
Modern: undici (built-in fetch)
Node 18+ ships fetch from undici. For HTTP-CONNECT proxies you need undici's ProxyAgent:
npm i undiciimport { fetch, ProxyAgent } from "undici";
const agent = new ProxyAgent(
"http://helo_s1a2b3c4d5e-type-res-region-us:PASSWORD@gate.helodata.io:7777"
);
const res = await fetch("https://ipv4.icanhazip.com", { dispatcher: agent });
console.log((await res.text()).trim());
console.log("Exit IP:", res.headers.get("x-helodata-exit-ip"));For ISP, swap the URL to http://helo_s1a2b3c4d5e:PASSWORD@198.51.100.42:8000.
SOCKS5 with undici
npm i socks-proxy-agentimport { SocksProxyAgent } from "socks-proxy-agent";
import { fetch } from "undici";
const agent = new SocksProxyAgent(
"socks5://helo_s1a2b3c4d5e-type-res-region-us:PASSWORD@gate.helodata.io:7777"
);
const res = await fetch("https://ipv4.icanhazip.com", { dispatcher: agent });axios
Set
proxy: falseon the axios call — otherwise axios will second-guess your agent using its ownenv-based proxy logic.
ISP rotation
Sticky sessions (residential)
Verify
Common pitfalls
HTTP_PROXYenvvar mode inundici— pre-1.x undici didn't honor env vars. UseProxyAgentexplicitly.axios +
proxy: { host, port }— that syntax does not use HTTP-CONNECT, it tries a request-rewrite that breaks HTTPS. Always use anhttpAgent/httpsAgent.Connection reuse —
undici.Agent(the default dispatcher) pools connections; if you mint a newProxyAgentper request you lose the pool. For ISP, share one agent per IP.
Last updated
Was this helpful?