
Security News
Insecure Agents Podcast: Certified Patches, Supply Chain Security, and AI Agents
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.
auto-http-agent
Advanced tools
Create an http agent for proxies and/or keepAlive. Returns a proxy if a given URL should be proxied according to the HTTP_PROXY, HTTPS_PROXY and NO_PROXY environment variables. Uses a global pool of agents for up to 8 combinations of options (for example, proxied https URLs will share an agent).
const autoAgent = require('auto-http-agent')
const url = 'http://example.com'
const agent = autoAgent(url)
// Pass to your module of choice
request(url, { agent })
autoAgent(url[, options])The url argument is required and must either be a string or a WHATWG URL instance, with an HTTP or HTTPS protocol.
Options:
keepAlive (boolean): reuse connections between requests, default false.Returns an agent or null if the default agent can be used (i.e. http.globalAgent or https.globalAgent). Has a fast path for the common case of not having any configured proxy. The autoAgent module should behave the same as good old request and other software. It respects the following environment variables.
HTTP_PROXYA proxy URL to use for HTTP requests, e.g. http://localhost:3000. The proxy itself can be either HTTP or HTTPS.
HTTPS_PROXYA proxy URL to use for HTTPS requests. The proxy itself can be either HTTP or HTTPS.
NO_PROXYA comma-separated list of hosts (including subdomains) that should not be proxied. Supported forms:
hostname:porthostname or .hostname or *.hostname* to disable proxying for all URLsWith npm do:
npm install auto-http-agent
MIT © Vincent Weevers
FAQs
Create http agent for HTTP(S)_PROXY proxies and/or keepAlive
We found that auto-http-agent demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.

Security News
The planned feature introduces a review step before releases go live, following the Shai-Hulud attacks and a rocky migration off classic tokens that disrupted maintainer workflows.