{"name":"proxy-agent","version":"8.0.1","keywords":["http","https","socks","agent","mapping","proxy"],"author":{"url":"http://n8.io/","name":"Nathan Rajlich","email":"nathan@tootallnate.net"},"license":"MIT","_id":"proxy-agent@8.0.1","maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"}],"homepage":"https://github.com/TooTallNate/proxy-agents#readme","bugs":{"url":"https://github.com/TooTallNate/proxy-agents/issues"},"dist":{"shasum":"4819c7b14637c6940424aeed840e9883a378a15d","tarball":"http://registry-npm.ywwl.com/proxy-agent/download/proxy-agent-8.0.1.tgz","fileCount":7,"integrity":"sha512-kccqGBqHZXR8onQhY/ganJjoO8QIKKRiFBhPOzbTZK16attzSZ/0XSmp9H7jrRxPKHjhGyx1q32lMPrJ3uLFgA==","signatures":[{"sig":"MEUCIQDOzUHODA3cVhDl65z2zowI9omOD9WQBs1AZarGFbeC1AIgaxttB377fFLYMSAlGw5MbF0qI7qZi/hBo3OadA0+y0M=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/proxy-agent@8.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":17453,"size":5533,"noattachment":false,"key":"/proxy-agent/-/proxy-agent-8.0.1.tgz"},"type":"module","_from":"file:proxy-agent-8.0.1.tgz","engines":{"node":">= 20"},"exports":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"scripts":{"lint":"eslint . --ext .ts","pack":"node ../../scripts/pack.mjs","test":"vitest","build":"tsc"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:cf65541a-aa7c-402c-bc86-f18da6f1fd1b"}},"_resolved":"/tmp/4327b9a178bdd4dab8fafc05078f4d52/proxy-agent-8.0.1.tgz","_integrity":"sha512-kccqGBqHZXR8onQhY/ganJjoO8QIKKRiFBhPOzbTZK16attzSZ/0XSmp9H7jrRxPKHjhGyx1q32lMPrJ3uLFgA==","repository":{"url":"git+https://github.com/TooTallNate/proxy-agents.git","type":"git","directory":"packages/proxy-agent"},"_npmVersion":"11.12.1","description":"Maps proxy protocols to `http.Agent` implementations","directories":{},"_nodeVersion":"20.20.2","dependencies":{"debug":"^4.3.4","lru-cache":"^7.14.1","agent-base":"9.0.0","proxy-from-env":"^2.0.0","pac-proxy-agent":"9.0.1","http-proxy-agent":"9.0.0","https-proxy-agent":"9.0.0","socks-proxy-agent":"10.0.0"},"_hasShrinkwrap":false,"devDependencies":{"ws":"^8.13.0","proxy":"4.0.0","socksv5":"github:TooTallNate/socksv5#d937368b28e929396166d77a06d387a4a902bd51","tsconfig":"0.0.0","@types/ws":"^8.5.4","typescript":"^5.1.6","@types/node":"^22.13.0","@types/debug":"^4.1.7","async-listen":"^3.0.0","@types/agent-base":"^4.2.0","@types/proxy-from-env":"^1.0.1"},"_npmOperationalInternal":{"tmp":"tmp/proxy-agent_8.0.1_1775457674213_0.4069535145714145","host":"s3://npm-registry-packages-npm-production"},"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":1775457674345,"_cnpm_publish_time":1775457674345,"dist-tags":{"latest":"8.0.3"}}