{"name":"proxy-agent","version":"8.0.2","type":"module","description":"Maps proxy protocols to `http.Agent` implementations","exports":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"engines":{"node":">= 20"},"repository":{"type":"git","url":"git+https://github.com/TooTallNate/proxy-agents.git","directory":"packages/proxy-agent"},"keywords":["http","https","socks","agent","mapping","proxy"],"author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net","url":"http://n8.io/"},"license":"MIT","dependencies":{"debug":"^4.3.4","lru-cache":"^7.14.1","proxy-from-env":"^2.0.0","agent-base":"9.0.0","http-proxy-agent":"9.1.0","https-proxy-agent":"9.1.0","pac-proxy-agent":"9.1.0","socks-proxy-agent":"10.1.0"},"devDependencies":{"@types/agent-base":"^4.2.0","@types/debug":"^4.1.7","@types/node":"^22.13.0","@types/proxy-from-env":"^1.0.1","@types/ws":"^8.5.4","async-listen":"^3.0.0","socksv5":"github:TooTallNate/socksv5#d937368b28e929396166d77a06d387a4a902bd51","typescript":"^5.1.6","ws":"^8.20.1","tsconfig":"0.0.0","proxy":"4.1.0"},"scripts":{"build":"tsc","test":"vitest","lint":"eslint . --ext .ts","pack":"node ../../scripts/pack.mjs"},"_id":"proxy-agent@8.0.2","bugs":{"url":"https://github.com/TooTallNate/proxy-agents/issues"},"homepage":"https://github.com/TooTallNate/proxy-agents#readme","_integrity":"sha512-idLLRewuemWd7GH/BDJzGiB0dWGfT2SQs3jy6NtZtGWU9uPTTSdeC1/cdbqLwgzhfv027daGFuXX426e2Eg20A==","_resolved":"/tmp/130933e155e5db274f4f051476d9220b/proxy-agent-8.0.2.tgz","_from":"file:proxy-agent-8.0.2.tgz","_nodeVersion":"20.20.2","_npmVersion":"11.16.0","dist":{"integrity":"sha512-idLLRewuemWd7GH/BDJzGiB0dWGfT2SQs3jy6NtZtGWU9uPTTSdeC1/cdbqLwgzhfv027daGFuXX426e2Eg20A==","shasum":"70737a3b9cdc8bd7a282c9e6ff54a64f5252413c","tarball":"http://registry-npm.ywwl.com/proxy-agent/download/proxy-agent-8.0.2.tgz","fileCount":7,"unpackedSize":17453,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/proxy-agent@8.0.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIDk79iZ609qXZ5bcSB2aPlnoGOmeiZY15LZTgkKELpt0AiAnSuhte7qUGy4HPP5GsNhe8dPHKfI04RFlOQA5cnUZ7g=="}],"size":5538,"noattachment":false,"key":"/proxy-agent/-/proxy-agent-8.0.2.tgz"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:cf65541a-aa7c-402c-bc86-f18da6f1fd1b"}},"directories":{},"maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/proxy-agent_8.0.2_1780937258670_0.27298241131943324"},"_hasShrinkwrap":false,"readme":"proxy-agent\n===========\n### Maps proxy protocols to `http.Agent` implementations\n\nThis module provides an `http.Agent` implementation which automatically uses\nproxy servers based off of the various proxy-related environment variables\n(`HTTP_PROXY`, `HTTPS_PROXY` and `NO_PROXY` among others).\n\nWhich proxy is used for each HTTP request is determined by the\n[`proxy-from-env`](https://www.npmjs.com/package/proxy-from-env) module, so\ncheck its documentation for instructions on configuring your environment variables.\n\nAn LRU cache is used so that `http.Agent` instances are transparently re-used for\nsubsequent HTTP requests to the same proxy server.\n\nThe currently implemented protocol mappings are listed in the table below:\n\n\n| Protocol   | Proxy Agent for `http` requests | Proxy Agent for `https` requests | Example\n|:----------:|:-------------------------------:|:--------------------------------:|:--------:\n| `http`     | [http-proxy-agent][]            | [https-proxy-agent][]            | `http://proxy-server-over-tcp.com:3128`\n| `https`    | [http-proxy-agent][]            | [https-proxy-agent][]            | `https://proxy-server-over-tls.com:3129`\n| `socks(v5)`| [socks-proxy-agent][]           | [socks-proxy-agent][]            | `socks://username:password@some-socks-proxy.com:9050` (username & password are optional)\n| `socks5`   | [socks-proxy-agent][]           | [socks-proxy-agent][]            | `socks5://username:password@some-socks-proxy.com:9050` (username & password are optional)\n| `socks4`   | [socks-proxy-agent][]           | [socks-proxy-agent][]            | `socks4://some-socks-proxy.com:9050`\n| `pac-*`    | [pac-proxy-agent][]             | [pac-proxy-agent][]              | `pac+http://www.example.com/proxy.pac`\n\nExample\n-------\n\n```ts\nimport * as https from 'https';\nimport { ProxyAgent } from 'proxy-agent';\n\n// The correct proxy `Agent` implementation to use will be determined\n// via the `http_proxy` / `https_proxy` / `no_proxy` / etc. env vars\nconst agent = new ProxyAgent();\n\n// The rest works just like any other normal HTTP request\nhttps.get('https://jsonip.com', { agent }, (res) => {\n  console.log(res.statusCode, res.headers);\n  res.pipe(process.stdout);\n});\n```\n\n\nAPI\n---\n\n### new ProxyAgent(options?: ProxyAgentOptions)\n\nCreates an `http.Agent` instance which relies on the various proxy-related\nenvironment variables. An LRU cache is used, so the same `http.Agent` instance\nwill be returned if identical args are passed in.\n\n[http-proxy-agent]: ../http-proxy-agent\n[https-proxy-agent]: ../https-proxy-agent\n[socks-proxy-agent]: ../socks-proxy-agent\n[pac-proxy-agent]: ../pac-proxy-agent\n","publish_time":1780937258809,"_cnpm_publish_time":1780937258809,"dist-tags":{"latest":"8.0.3"}}