For the complete documentation index, see llms.txt. This page is also available as Markdown.

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 undici
import { 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-agent
import { 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: false on the axios call — otherwise axios will second-guess your agent using its own env-based proxy logic.

ISP rotation

Sticky sessions (residential)

Verify

Common pitfalls

  • HTTP_PROXY envvar mode in undici — pre-1.x undici didn't honor env vars. Use ProxyAgent explicitly.

  • axios + proxy: { host, port } — that syntax does not use HTTP-CONNECT, it tries a request-rewrite that breaks HTTPS. Always use an httpAgent/httpsAgent.

  • Connection reuseundici.Agent (the default dispatcher) pools connections; if you mint a new ProxyAgent per request you lose the pool. For ISP, share one agent per IP.

Last updated

Was this helpful?