JS
Languages & HTTP Clients
Node.js (Axios) proxy integration
Node's Axios doesn't tunnel HTTPS-over-HTTP proxies reliably through its built-in proxy option, so the standard approach is an https-proxy-agent. Point the agent at your Aethyn endpoint and pass it as both httpAgent and httpsAgent.
Setup steps
- 1Install dependencies: npm install axios https-proxy-agent.
- 2Create an HttpsProxyAgent with your Aethyn credentials.
- 3Pass the agent to Axios as httpAgent and httpsAgent.
- 4Disable Axios's own proxy handling with proxy: false.
Code
Axios with https-proxy-agent
import axios from "axios";
import { HttpsProxyAgent } from "https-proxy-agent";
const agent = new HttpsProxyAgent(
"http://aethyn-XXXXX-country-us:PASSWORD@proxy.aethyn.io:2099"
);
const { data } = await axios.get("https://httpbin.org/ip", {
httpAgent: agent,
httpsAgent: agent,
proxy: false, // let the agent handle it
});
console.log(data);Native fetch (Node 18+) with undici
import { ProxyAgent, fetch } from "undici";
const dispatcher = new ProxyAgent(
"http://aethyn-XXXXX:PASSWORD@proxy.aethyn.io:2099"
);
const res = await fetch("https://httpbin.org/ip", { dispatcher });
console.log(await res.json());Replace aethyn-XXXXX and PASSWORD with your dashboard credentials. See the full targeting reference and protocol/port list. Or use the official proxy-builder-sdk to build targeting strings without hand-assembling usernames.
Tips
- Set proxy: false on the Axios call so it doesn't fight the agent.
- Reuse one agent instance across requests to pool connections.
- For browser-style scraping, pair this with Puppeteer or Playwright instead.
Node.js (Axios) proxy FAQ
Why doesn't Axios's built-in proxy option work?
Axios's proxy option struggles with HTTPS targets through an HTTP proxy. Using https-proxy-agent (or undici's ProxyAgent for fetch) is the reliable pattern for residential proxies.
Docs, solutions & blog
Related solution guideEnd-to-end workflow that pairs with this integration.Node.js SDKproxy-builder-sdk on npm — TypeScript types, forPlaywright(), and multi-provider support.Premium residential proxiesCost-efficient rotating residential pool from €2.00/GB for bulk scraping and monitoring.Elite residential proxiesCurated high-trust pool with city and ISP targeting for hard anti-bot targets.Quickstart docsCredentials, endpoints, and your first proxied request.Proxy glossaryPlain-English definitions for residential proxies, rotation, anti-bot, and scraping terms.