In this Article
Node.js is everywhere in scraping and automation — and the two ways most people make HTTP calls are Axios and the built-in fetch. Adding a proxy to either is easy once you know the right pattern, but both have gotchas: Axios’s built-in proxy option is unreliable for HTTPS, and native fetch has no proxy option at all — you route it through an agent/dispatcher instead. This guide shows exactly how to use a proxy with Node.js (Axios, native fetch, node-fetch, SOCKS5, and rotation), then ranks the 8 best proxies for Node.js in 2026. DataImpulse at $1/GB is the value baseline.
I’m Andrii Byzov, an AI-Native Fractional CMO who ships Node scrapers daily. Below: the copy-paste patterns that actually work, the Axios-HTTPS gotcha, and the providers worth your budget.
Key Facts
- For Axios, use a proxy agent, not the built-in option. Axios’s
proxyconfig is unreliable for HTTPS targets — pass anhttps-proxy-agentashttpsAgentand setproxy: false. - Native
fetch(Node 18+) has no proxy option. Route it through undici’sProxyAgentvia thedispatcheroption. - node-fetch (the npm package; v3 is ESM-only) takes an
agent— usehttps-proxy-agent. - Credentials go in the proxy URL —
http://user:pass@host:port— and SOCKS5 usessocks-proxy-agent. - DataImpulse is the value pick — residential $1/GB pay-as-you-go, datacenter $0.50/GB, mobile $2/GB, 90M+ IPs across 195 countries, HTTP/HTTPS/SOCKS5, country/city/ASN targeting.
How to Use a Proxy with Node.js
1. Axios (with https-proxy-agent — the reliable way)
// npm i axios https-proxy-agent
const axios = require('axios');
const { HttpsProxyAgent } = require('https-proxy-agent');
const proxy = 'http://YOUR_LOGIN__cr.us:[email protected]:823'; // __cr.us = US
const agent = new HttpsProxyAgent(proxy);
axios.get('https://httpbin.org/ip', { httpsAgent: agent, proxy: false })
.then(r => console.log(r.data)); // confirm the egress IP
Setting proxy: false tells Axios to use the agent rather than its own (buggy for HTTPS) proxy handling. Credentials in the URL are applied automatically.
2. Native fetch (Node 18+) via undici ProxyAgent
// npm i undici
const { ProxyAgent } = require('undici');
const dispatcher = new ProxyAgent('http://YOUR_LOGIN__cr.us:[email protected]:823');
const res = await fetch('https://httpbin.org/ip', { dispatcher });
console.log(await res.json());
Native fetch has no proxy option, so you pass a dispatcher. Use setGlobalDispatcher(dispatcher) from undici to apply it to every fetch call.
3. node-fetch via agent
// npm i node-fetch https-proxy-agent
// node-fetch v3 is ESM-only — use import (or pin node-fetch@2 for require)
import fetch from 'node-fetch';
import { HttpsProxyAgent } from 'https-proxy-agent';
const agent = new HttpsProxyAgent('http://YOUR_LOGIN__cr.us:[email protected]:823');
const res = await fetch('https://httpbin.org/ip', { agent });
console.log(await res.json());
4. SOCKS5 & rotation
// npm i socks-proxy-agent — for SOCKS5 (port 824)
const { SocksProxyAgent } = require('socks-proxy-agent');
const agent = new SocksProxyAgent('socks5://YOUR_LOGIN__cr.us:[email protected]:824');
axios.get('https://httpbin.org/ip', { httpsAgent: agent, proxy: false }).then(r => console.log(r.data));
With DataImpulse’s rotating residential gateway, each request through the agent egresses from a fresh IP — no proxy list to manage. To rotate a static list, build a new agent per request from a different proxy URL.
Best Proxies for Node.js at a Glance
| Provider | Best for Node.js | Residential price | Protocols | Notable |
|---|---|---|---|---|
| DataImpulse | Best value, scrapers & bots | $1/GB PAYG | HTTP/HTTPS/SOCKS5 | 90M+ pool, never-expires |
| Bright Data | Enterprise + managed | ~$4/GB promo; $8 regular | HTTP/HTTPS/SOCKS5 | Web Unlocker, SERP API, datasets |
| Oxylabs | Enterprise SLA | from $6/GB | HTTP/HTTPS/SOCKS5 | 175M+ pool, scraper APIs |
| Decodo | Mid-market, full geo grid | $3.75/GB (~$2 at 1TB+) | HTTP/HTTPS/SOCKS5 | 115M+ pool, sticky to 24h |
| IPRoyal | Long sticky sessions | from $7.35/GB | HTTP/HTTPS/SOCKS5 | Sticky up to 7 days; cheap PAYG |
| SOAX | Residential + mobile mix | $3.60/GB Starter | HTTP/HTTPS/SOCKS5 | 155M+ res, 33M+ mobile |
| Webshare | Budget / self-serve | from $3.50/mo res; $2.99/mo DC | HTTP/SOCKS5 | Free tier, cheapest datacenter |
| NetNut | ISP-residential stability | from $3.53/GB | HTTP/HTTPS | Consumer-ISP static IPs |

The picks, briefly
DataImpulse is the value baseline for Node.js work — residential at $1/GB pay-as-you-go (datacenter $0.50/GB, mobile $2/GB), 90M+ IPs across 195 countries, HTTP/HTTPS and SOCKS5, with country/city/ASN targeting in the username. Traffic never expires, so dev runs don’t burn a subscription. Published success rate 99.51%; G2 4.8/5; 24/7 human support. For high-volume Node scraping, it’s the lowest cost per successful request.
Bright Data is the enterprise pick (residential ~$8/GB regular, ~$4 promo) with Web Unlocker, SERP API, and datasets. Oxylabs (from $6/GB, 175M+ pool) is the SLA-grade option. Decodo (from $3.75/GB, sticky to 24h) is the balanced mid-market choice. IPRoyal (from $7.35/GB, sticky up to 7 days) suits long, session-stable scripts. SOAX ($3.60/GB, 155M+ residential + 33M+ mobile) adds a strong mobile pool. Webshare (free tier, datacenter from $2.99/mo) is the budget self-serve entry, and NetNut (from $3.53/GB) is the ISP-residential stability pick.
Common Node.js Proxy Mistakes
- Relying on Axios’s built-in
proxyoption for HTTPS. It’s unreliable on HTTPS targets — use anhttps-proxy-agentashttpsAgentand setproxy: false. - Expecting native
fetchto take aproxyoption. It doesn’t — pass an undiciProxyAgentviadispatcher. - Wrong agent for the scheme. Use
https-proxy-agentfor HTTP/HTTPS proxies andsocks-proxy-agentfor SOCKS5. - No timeout. A dead proxy can hang a request; set a timeout on Axios or an
AbortControllerfor fetch. - Datacenter IPs on defended targets — they get blocked fast; use residential and realistic headers (User-Agent).
Rotating vs Sticky Proxies with Node.js
For broad scraping, a rotating residential gateway is ideal — each request through the agent gets a fresh IP. For stateful flows (login then follow-up calls), keep a sticky proxy and reuse an Axios instance or a cookie jar so the same IP and cookies persist. Most Node scraping is stateless, so rotating is the common default.
Which Proxy Type for Node.js — Residential, Datacenter, or Mobile?
- Residential ($1/GB) — the default for defended targets (e-commerce, SERPs, social). If you pick one, pick this.
- Mobile ($2/GB) — real carrier IPs for the hardest targets and mobile-web surfaces.
- Datacenter ($0.50/GB) — cheapest and fastest for unprotected work, APIs, and your own infrastructure; don’t point it at anti-bot-heavy sites.
DataImpulse offers all three on one pay-as-you-go account, so a single Node scraper can route each request to the right tier via the username and endpoint.
How to Start with DataImpulse + Node.js
Step 1. Create a DataImpulse account and grab residential credentials. The $5 / 5GB intro never expires — a real test budget.
Step 2. Build an https-proxy-agent from http://YOUR_LOGIN__cr.us:[email protected]:823, pass it as httpsAgent (Axios) or dispatcher/agent (fetch/node-fetch), and append a country code for geo-targeting. Use socks-proxy-agent + port 824 for SOCKS5.
Step 3. Add timeouts, send realistic headers, and let the rotating gateway give a fresh IP per request. See the DataImpulse tutorials and the residential proxies page.
FAQ
How do I use a proxy with Axios?
Use a proxy agent, not Axios’s built-in option (it’s unreliable for HTTPS). Install https-proxy-agent, build an agent from your proxy URL, and pass it as httpsAgent with proxy: false: axios.get(url, { httpsAgent: new HttpsProxyAgent('http://user:pass@host:port'), proxy: false }). For DataImpulse use gw.dataimpulse.com:823.
How do I use a proxy with native fetch in Node.js?
Native fetch (Node 18+) has no proxy option — route it through undici’s ProxyAgent: const dispatcher = new ProxyAgent('http://user:pass@host:port'); fetch(url, { dispatcher }). Use setGlobalDispatcher(dispatcher) to apply it to all fetch calls.
What’s the best proxy for Node.js?
Residential proxies for defended targets — DataImpulse at $1/GB is the value pick (HTTP/HTTPS/SOCKS5, 90M+ IPs, never-expiring traffic). Bright Data and Oxylabs are the enterprise options; Webshare is cheapest to start. All work with an https-proxy-agent (Axios/node-fetch) or undici ProxyAgent (native fetch).
Does Node.js support SOCKS5 proxies?
Yes — use the socks-proxy-agent package. Build new SocksProxyAgent('socks5://user:pass@host:port') and pass it as the agent (Axios httpsAgent, node-fetch agent). DataImpulse exposes SOCKS5 on port 824. For native fetch, an undici-compatible SOCKS dispatcher is needed.
Why doesn’t my Axios proxy work on HTTPS sites?
Axios’s built-in proxy config has long-standing issues tunneling HTTPS. The fix is to bypass it: set proxy: false and pass an https-proxy-agent as httpsAgent. The agent handles the CONNECT tunnel correctly. Put credentials in the proxy URL.
How much do Node.js proxies cost?
Raw residential is priced per GB — DataImpulse $1/GB (value floor), NetNut from $3.53, SOAX $3.60, Decodo $3.75, Oxylabs from $6, IPRoyal $7.35; Webshare offers budget subscriptions from $3.50/mo. A fetched page is a small fraction of a GB, so per-GB residential is far cheaper than per-record managed APIs for high-volume scraping; managed options suit the hardest targets.

State/City/Zip/ASN Targeting 



