https-proxy-agent
Send Node.js requests through a proxy.
1. License
“Permission is hereby granted, free of charge, to any person obtaining”
Paid and closed-source products may use it; no fee and no on-screen credit needed.
github.com/TooTallNate/proxy-agents/blob/main/packages/https-proxy-agent/LICENSE3. Used by agents' projects
Dependency in 33 public GitHub projects set up for AI coding agents that we scanned (0.5%).
4. Agent access
Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.
From the package registry and GitHub, checked daily; card checked Nov 10, 2026. Tap a verdict to see its source.How we checkedReport an error
What https-proxy-agent does
https-proxy-agent is a small free JavaScript package for Node.js. It makes your server's outgoing secure requests and WebSocket connections go through a proxy server, as many company and school networks require. You give it the proxy address once and hand it to each request.
What people build with it
Reach outside services behind a company proxy
Your Node.js tool runs on a work network where every connection must pass the company proxy; its secure requests then get out instead of timing out.
Live connections through a proxy
A chat or live-update feature that uses WebSockets keeps working when the server sits behind a proxy.
Proxies that need a login
Put the user name and password into the proxy address, or answer a company Kerberos login with the built-in option.
Extra headers for the proxy
Some proxies want a team or tracing header on each tunnel; the agent sends it only to the proxy, not to the destination site.
Calls from one fixed address Idea
A partner service only accepts calls from addresses on its allow list; your app sends those calls through your own proxy with a fixed address.
Log which proxy was used
When requests fail on some machines, the request reports which proxy it went through, so the logs show the cause.
https-proxy-agent popularity
Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated
How https-proxy-agent is used
- https-proxy-agent is a dependency in 33 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (0.7% of the 4,867 JavaScript/TypeScript ones), #17 of 126 in http clients and networking.
- Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 157; those are left out of every share on this page.
- Projects that use it most often also use Vitest (87.9%), undici (78.8%), tsx (72.7%).
By coding agent
Often used with
More about https-proxy-agent
More in HTTP clients and networking
Alternatives
https-proxy-agent This page
Pick http-proxy-agent for plain http:// requests through a proxy; it is the sibling package from the same project.
Pick socks-proxy-agent when your proxy speaks SOCKS (addresses that start with socks:// or socks5://).
Pick undici's ProxyAgent or EnvHttpProxyAgent when your code uses fetch() rather than the https module or ws.
Get started
Tell your AI assistant
“Use the npm package https-proxy-agent (pin https-proxy-agent@9.1.0, Node.js 20+) and create new HttpsProxyAgent(process.env.HTTPS_PROXY) once; pass it as the agent option of the https and ws requests, and use undici's EnvHttpProxyAgent for fetch() calls.”
Add the package to your Node.js project (Node.js 20 or newer for version 9; it ships as an ES module).
npm install https-proxy-agentFrom github.com/TooTallNate/proxy-agents/blob/main/packages/https-proxy-agent/CHANGELOG.md
Create one agent with your proxy address and pass it to each request as the agent option.
import { HttpsProxyAgent } from 'https-proxy-agent'; const agent = new HttpsProxyAgent('http://168.63.76.32:3128');From github.com/TooTallNate/proxy-agents/blob/main/packages/https-proxy-agent/README.md
Mistakes to avoid
The address in the examples is a sample; sending your app's traffic through an unknown proxy exposes which sites it calls and any proxy login.
Node's fetch runs on undici, which routes requests through dispatchers, not through an agent option.
https-proxy-agent is the low-level piece; the env-variable handling lives in proxy-agent.
Version 6 split the constructor into a URL plus an options object.
Version 8 moved to ES modules and version 9 raised the minimum to Node.js 20.
Questions
Does it pick up HTTPS_PROXY from the environment?
No. Read the variable yourself and pass it in, or use the project's proxy-agent package, which follows the proxy environment variables.
Does it work with fetch()?
Not with the fetch() built into Node.js, which runs on undici; use undici's EnvHttpProxyAgent or ProxyAgent there.
My old code passes an object like { host, port, auth } and now fails. Why?
Since version 6 the constructor takes the proxy URL as the first argument and other options as a second one.
Can it log in to a proxy that asks for a password?
Yes. Put the user and password in the proxy URL, or for Kerberos proxies use the negotiate option added in 9.1.0.
Is it still maintained?
Yes. Version 9.1.0 came out on 2026-06-08 with new login and logging features.