Skip to content
Agents tracked: 506 Releases (7d): 634 Agent status: 3 with issuesSince last limit reset: Claude 15d · Codex 0d For AI agents: Markdown Updated Nov 26, 2026

https-proxy-agent

Send Node.js requests through a proxy.

HTTP clients and networkingNPM

GitHubWebsite

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/LICENSE

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

63 / 100
Gid Score, #771 overall
394M
downloads a week, npm
1,171
GitHub stars
33
agent projects use it
https-proxy-agent: downloads per weeknpm, https-proxy-agent 393,621,569
https-proxy-agent: GitHub starsTooTallNate/proxy-agents 1,171

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

28 projects, 0.9%
22 projects, 0.7%
12 projects, 2.5%
11 projects, 3.3%

Often used with

In 87.9% of its projects
In 78.8% of its projects
In 72.7% of its projects
In 84.8% of its projects
In 69.7% of its projects
In 60.6% of its projects
In 54.5% of its projects

More about https-proxy-agent

More in HTTP clients and networking

Alternatives

https-proxy-agent This page

MITGid 63394M/wk

http-proxy-agent

Pick http-proxy-agent for plain http:// requests through a proxy; it is the sibling package from the same project.

SOCKS Proxy Agent

Pick socks-proxy-agent when your proxy speaks SOCKS (addresses that start with socks:// or socks5://).

undici

Pick undici's ProxyAgent or EnvHttpProxyAgent when your code uses fetch() rather than the https module or ws.

Compare https-proxy-agent with another tool

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.”

  1. 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-agent

    From github.com/TooTallNate/proxy-agents/blob/main/packages/https-proxy-agent/CHANGELOG.md

  2. 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

new HttpsProxyAgent('http://168.63.76.32:3128') copied from the README example
new HttpsProxyAgent(process.env.HTTPS_PROXY) with your own or your company's proxy

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.

await fetch(url, { agent }) with Node's built-in fetch
import { EnvHttpProxyAgent, setGlobalDispatcher } from 'undici'; setGlobalDispatcher(new EnvHttpProxyAgent())

Node's fetch runs on undici, which routes requests through dispatchers, not through an agent option.

Expecting HTTPS_PROXY and NO_PROXY to be honoured automatically
Pass the proxy URL yourself and skip local hosts in your code, or use proxy-agent / undici's EnvHttpProxyAgent

https-proxy-agent is the low-level piece; the env-variable handling lives in proxy-agent.

new HttpsProxyAgent({ host: 'myproxy', port: 1234, auth: 'user:pass' }) (5.x style)
new HttpsProxyAgent('http://user:pass@myproxy:1234', { timeout: 1000 })

Version 6 split the constructor into a URL plus an options object.

const { HttpsProxyAgent } = require('https-proxy-agent') on Node.js 18
Run Node.js 20+ and use import { HttpsProxyAgent } from 'https-proxy-agent', or stay on 7.0.x for old setups

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.