{
 "kind": "tool",
 "slug": "https-proxy-agent",
 "path": "tools/https-proxy-agent/",
 "name": "https-proxy-agent",
 "maker": null,
 "density": "full",
 "crumbs": [
  [
   "Tools",
   "tools/"
  ],
  [
   "HTTP clients and networking",
   "tools/http-clients/"
  ]
 ],
 "lead": "Send Node.js requests through a proxy.",
 "chips": [
  {
   "label": "HTTP clients and networking",
   "path": "tools/http-clients/"
  },
  {
   "label": "NPM"
  }
 ],
 "primary": {
  "label": "Copy install command",
  "copy": "npm install https-proxy-agent"
 },
 "links": [
  {
   "label": "GitHub",
   "href": "https://github.com/TooTallNate/proxy-agents"
  },
  {
   "label": "Website",
   "href": "https://github.com/TooTallNate/proxy-agents#readme"
  }
 ],
 "track": "New versions, deprecation and license changes on your dashboard",
 "verdicts": [
  {
   "key": "license",
   "label": "License",
   "value": "MIT",
   "status": "yes",
   "sub": "Use it in paid apps",
   "quote": "Permission is hereby granted, free of charge, to any person obtaining",
   "note": "Paid and closed-source products may use it; no fee and no on-screen credit needed.",
   "src": "https://github.com/TooTallNate/proxy-agents/blob/main/packages/https-proxy-agent/LICENSE"
  },
  {
   "key": "maint",
   "label": "Maintained",
   "value": "Maintained",
   "status": "yes",
   "sub": "Last change today",
   "note": "Latest GitHub release Nov 16, 2026. ",
   "src": "https://github.com/TooTallNate/proxy-agents"
  },
  {
   "key": "pop",
   "label": "Used by agents' projects",
   "value": "33 projects",
   "status": "info",
   "sub": "#17 of 126 in its category",
   "note": "Dependency in 33 public GitHub projects set up for AI coding agents that we scanned (0.5%).",
   "src": null
  },
  {
   "key": "agent",
   "label": "Agent access",
   "value": "Install only",
   "status": "info",
   "sub": null,
   "note": "Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.",
   "src": null
  }
 ],
 "vfoot": "From the package registry and GitHub, checked daily; card checked Nov 10, 2026.",
 "blocks": [
  {
   "id": "overview",
   "nav": "Overview",
   "h2": "What https-proxy-agent does",
   "parts": [
    {
     "t": "prose",
     "text": "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."
    },
    {
     "t": "h3",
     "text": "What people build with it"
    },
    {
     "t": "uses",
     "items": [
      {
       "title": "Reach outside services behind a company proxy",
       "text": "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.",
       "idea": false
      },
      {
       "title": "Live connections through a proxy",
       "text": "A chat or live-update feature that uses WebSockets keeps working when the server sits behind a proxy.",
       "idea": false
      },
      {
       "title": "Proxies that need a login",
       "text": "Put the user name and password into the proxy address, or answer a company Kerberos login with the built-in option.",
       "idea": false
      },
      {
       "title": "Extra headers for the proxy",
       "text": "Some proxies want a team or tracing header on each tunnel; the agent sends it only to the proxy, not to the destination site.",
       "idea": false
      },
      {
       "title": "Calls from one fixed address",
       "text": "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.",
       "idea": true
      },
      {
       "title": "Log which proxy was used",
       "text": "When requests fail on some machines, the request reports which proxy it went through, so the logs show the cause.",
       "idea": false
      }
     ]
    }
   ]
  },
  {
   "id": "popularity",
   "nav": "Popularity",
   "h2": "https-proxy-agent popularity",
   "parts": [
    {
     "t": "stats",
     "items": [
      {
       "n": "63",
       "of": "/ 100",
       "l": "Gid Score, #771 overall"
      },
      {
       "n": "394M",
       "l": "downloads a week, npm"
      },
      {
       "n": "1,171",
       "l": "GitHub stars"
      },
      {
       "n": "33",
       "l": "agent projects use it"
      }
     ]
    },
    {
     "t": "small",
     "text": "Gid Score measures public popularity and activity, not quality.",
     "link": "How the Gid Score is calculated",
     "path": "tools/top/"
    }
   ]
  },
  {
   "id": "usage",
   "nav": "How it is used",
   "h2": "How https-proxy-agent is used",
   "parts": [
    {
     "t": "list",
     "items": [
      "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%)."
     ]
    },
    {
     "t": "h3",
     "text": "By coding agent"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "28 projects, 0.9%",
       "v": "Claude Code",
       "path": "agents/claude-code/"
      },
      {
       "l": "22 projects, 0.7%",
       "v": "GitHub Copilot",
       "path": "agents/github-copilot/"
      },
      {
       "l": "12 projects, 2.5%",
       "v": "Gemini CLI",
       "path": "agents/gemini-cli/"
      },
      {
       "l": "11 projects, 3.3%",
       "v": "OpenClaw",
       "path": "agents/openclaw/"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Often used with"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "In 87.9% of its projects",
       "v": "Vitest",
       "path": "tools/vitest/"
      },
      {
       "l": "In 78.8% of its projects",
       "v": "undici",
       "path": "tools/undici/"
      },
      {
       "l": "In 72.7% of its projects",
       "v": "tsx",
       "path": "tools/tsx/"
      },
      {
       "l": "In 84.8% of its projects",
       "v": "Zod",
       "path": "tools/zod/"
      },
      {
       "l": "In 69.7% of its projects",
       "v": "ws",
       "path": "tools/ws/"
      },
      {
       "l": "In 63.6% of its projects",
       "v": "Model Context Protocol SDK (JavaScript)",
       "path": "tools/modelcontextprotocol/"
      },
      {
       "l": "In 60.6% of its projects",
       "v": "AWS SDK for JavaScript (S3)",
       "path": "tools/aws-sdk-client-s3/"
      },
      {
       "l": "In 54.5% of its projects",
       "v": "Axios",
       "path": "tools/axios/"
      }
     ]
    }
   ]
  },
  {
   "id": "more",
   "nav": null,
   "spy_as": "usage",
   "h2": "More about https-proxy-agent",
   "parts": [
    {
     "t": "more",
     "items": [
      {
       "title": "More in HTTP clients and networking",
       "path": "tools/http-clients/",
       "items": [
        {
         "text": "Axios",
         "path": "tools/axios/"
        },
        {
         "text": "Requests",
         "path": "tools/requests-py/"
        },
        {
         "text": "httpx",
         "path": "tools/httpx/"
        },
        {
         "text": "ws",
         "path": "tools/ws/"
        },
        {
         "text": "postgres",
         "path": "tools/postgres/"
        },
        {
         "text": "aiohttp",
         "path": "tools/aiohttp/"
        },
        {
         "text": "websockets",
         "path": "tools/websockets/"
        },
        {
         "text": "redis (Python)",
         "path": "tools/redis-pypi/"
        }
       ]
      }
     ]
    }
   ]
  },
  {
   "id": "alternatives",
   "nav": "Alternatives",
   "h2": "Alternatives",
   "parts": [
    {
     "t": "alts",
     "items": [
      {
       "name": "https-proxy-agent",
       "me": true,
       "facts": [
        "MIT",
        "Gid 63",
        "394M/wk"
       ]
      },
      {
       "name": "http-proxy-agent",
       "why": "Pick http-proxy-agent for plain http:// requests through a proxy; it is the sibling package from the same project.",
       "path": "tools/http-proxy-agent/",
       "facts": []
      },
      {
       "name": "SOCKS Proxy Agent",
       "why": "Pick socks-proxy-agent when your proxy speaks SOCKS (addresses that start with socks:// or socks5://).",
       "path": "tools/socks-proxy-agent/",
       "facts": []
      },
      {
       "name": "undici",
       "why": "Pick undici's ProxyAgent or EnvHttpProxyAgent when your code uses fetch() rather than the https module or ws.",
       "path": "tools/undici/",
       "facts": []
      }
     ],
     "more": "Compare https-proxy-agent with another tool",
     "more_path": "tools/compare/"
    }
   ]
  },
  {
   "id": "start",
   "nav": "Get started",
   "h2": "Get started",
   "parts": [
    {
     "t": "prompt",
     "text": "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."
    },
    {
     "t": "steps",
     "items": [
      {
       "text": "Add the package to your Node.js project (Node.js 20 or newer for version 9; it ships as an ES module).",
       "code": "npm install https-proxy-agent",
       "src": "https://github.com/TooTallNate/proxy-agents/blob/main/packages/https-proxy-agent/CHANGELOG.md"
      },
      {
       "text": "Create one agent with your proxy address and pass it to each request as the agent option.",
       "code": "import { HttpsProxyAgent } from 'https-proxy-agent';\nconst agent = new HttpsProxyAgent('http://168.63.76.32:3128');\n",
       "src": "https://github.com/TooTallNate/proxy-agents/blob/main/packages/https-proxy-agent/README.md"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Mistakes to avoid"
    },
    {
     "t": "mistakes",
     "items": [
      {
       "dont": "new HttpsProxyAgent('http://168.63.76.32:3128') copied from the README example",
       "fix": "new HttpsProxyAgent(process.env.HTTPS_PROXY) with your own or your company's proxy",
       "why": "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."
      },
      {
       "dont": "await fetch(url, { agent }) with Node's built-in fetch",
       "fix": "import { EnvHttpProxyAgent, setGlobalDispatcher } from 'undici'; setGlobalDispatcher(new EnvHttpProxyAgent())",
       "why": "Node's fetch runs on undici, which routes requests through dispatchers, not through an agent option."
      },
      {
       "dont": "Expecting HTTPS_PROXY and NO_PROXY to be honoured automatically",
       "fix": "Pass the proxy URL yourself and skip local hosts in your code, or use proxy-agent / undici's EnvHttpProxyAgent",
       "why": "https-proxy-agent is the low-level piece; the env-variable handling lives in proxy-agent."
      },
      {
       "dont": "new HttpsProxyAgent({ host: 'myproxy', port: 1234, auth: 'user:pass' }) (5.x style)",
       "fix": "new HttpsProxyAgent('http://user:pass@myproxy:1234', { timeout: 1000 })",
       "why": "Version 6 split the constructor into a URL plus an options object."
      },
      {
       "dont": "const { HttpsProxyAgent } = require('https-proxy-agent') on Node.js 18",
       "fix": "Run Node.js 20+ and use import { HttpsProxyAgent } from 'https-proxy-agent', or stay on 7.0.x for old setups",
       "why": "Version 8 moved to ES modules and version 9 raised the minimum to Node.js 20."
      }
     ]
    }
   ]
  },
  {
   "id": "faq",
   "nav": "Questions",
   "h2": "Questions",
   "parts": [
    {
     "t": "faq",
     "items": [
      {
       "q": "Does it pick up HTTPS_PROXY from the environment?",
       "a": "No. Read the variable yourself and pass it in, or use the project's proxy-agent package, which follows the proxy environment variables.",
       "evidence": {
        "url": "https://github.com/TooTallNate/proxy-agents/blob/main/packages/proxy-agent/README.md",
        "quote": "This module provides an http.Agent implementation which automatically uses proxy servers based off of the various proxy-related environment variables"
       }
      },
      {
       "q": "Does it work with fetch()?",
       "a": "Not with the fetch() built into Node.js, which runs on undici; use undici's EnvHttpProxyAgent or ProxyAgent there.",
       "evidence": {
        "url": "https://github.com/nodejs/undici/blob/main/docs/docs/api/EnvHttpProxyAgent.md",
        "quote": "that reads its proxy configuration from the http_proxy, https_proxy, and no_proxy environment variables"
       }
      },
      {
       "q": "My old code passes an object like { host, port, auth } and now fails. Why?",
       "a": "Since version 6 the constructor takes the proxy URL as the first argument and other options as a second one.",
       "evidence": {
        "url": "https://github.com/TooTallNate/proxy-agents/blob/main/packages/https-proxy-agent/CHANGELOG.md",
        "quote": "The HttpsProxyAgent constructor argument has been split into two arguments."
       }
      },
      {
       "q": "Can it log in to a proxy that asks for a password?",
       "a": "Yes. Put the user and password in the proxy URL, or for Kerberos proxies use the negotiate option added in 9.1.0.",
       "evidence": {
        "url": "https://github.com/TooTallNate/proxy-agents/blob/main/packages/https-proxy-agent/CHANGELOG.md",
        "quote": "Added negotiate: true option that uses the kerberos package for automatic Negotiate/SPNEGO auth"
       }
      },
      {
       "q": "Is it still maintained?",
       "a": "Yes. Version 9.1.0 came out on 2026-06-08 with new login and logging features.",
       "evidence": {
        "url": "https://registry.npmjs.org/https-proxy-agent",
        "quote": "\"9.1.0\":\"2026-06-08T16:47:28.029Z\""
       }
      }
     ]
    }
   ]
  }
 ],
 "glance": [
  [
   "Package",
   "npm https-proxy-agent"
  ],
  [
   "Category",
   "HTTP clients and networking"
  ],
  [
   "License",
   "MIT"
  ],
  [
   "Gid Score",
   "63.4"
  ],
  [
   "Rank in category",
   "#17 of 126"
  ],
  [
   "GitHub",
   "TooTallNate/proxy-agents"
  ],
  [
   "Last change",
   "Nov 17, 2026"
  ]
 ],
 "good": [
  "It does not read proxy settings from the environment by itself; you pass the address. The project points most people to its proxy-agent package for that.",
  "It plugs into Node's https and ws style requests through their agent option. The fetch() built into Node.js is a different engine and needs undici's proxy tools instead.",
  "Version 8 switched to ES modules and version 9 needs Node.js 20 or newer."
 ],
 "checked_line": "Read by AgentGid from 10 official pages, card checked Nov 10, 2026; numbers update daily.",
 "logo": "https://agentgid.com/media/avatars/tootallnate.png"
}