{"_id":"@httptoolkit/proxy-agent","_rev":"2-7ac6cae438dccf913bb35db2df556d15","name":"@httptoolkit/proxy-agent","dist-tags":{"latest":"5.0.1-socks-lookup-fix.0"},"versions":{"5.0.1-socks-lookup-fix.0":{"name":"@httptoolkit/proxy-agent","version":"5.0.1-socks-lookup-fix.0","description":"Maps proxy protocols to `http.Agent` implementations","main":"index.js","scripts":{"test":"mocha --reporter spec"},"engines":{"node":">= 8"},"repository":{"type":"git","url":"git://github.com/TooTallNate/node-proxy-agent.git"},"keywords":["http","https","socks","agent","mapping","proxy","cache"],"author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net","url":"http://n8.io/"},"license":"MIT","bugs":{"url":"https://github.com/TooTallNate/node-proxy-agent/issues"},"homepage":"https://github.com/TooTallNate/node-proxy-agent","dependencies":{"@httptoolkit/socks-proxy-agent":"^6.1.1-use-request-lookup-fix.0","agent-base":"^6.0.0","debug":"4","http-proxy-agent":"^4.0.0","https-proxy-agent":"^5.0.0","lru-cache":"^5.1.1","pac-proxy-agent":"^5.0.0","proxy-from-env":"^1.0.0"},"devDependencies":{"@types/agent-base":"^4.2.0","mocha":"^6.2.1","proxy":"^1.0.1","socksv5":"0.0.6","stream-to-buffer":"0.1.0"},"gitHead":"200b9455c4d0be57249134fb9a87690a5a8dc7a1","_id":"@httptoolkit/proxy-agent@5.0.1-socks-lookup-fix.0","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-AJvEMWzhrnVFZtfiJszkQI+ktxjcUK5lcqNnbOOhjw1JEbE3GE47LyflkVIVgB4SMZkbB53gtjiXcIEfXuPuvA==","shasum":"d213477b5cd7285fde2089d4800c01d6cedda7af","tarball":"https://registry.npmjs.org/@httptoolkit/proxy-agent/-/proxy-agent-5.0.1-socks-lookup-fix.0.tgz","fileCount":9,"unpackedSize":25596,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2K4MCRA9TVsSAnZWagAAZakQAI/pyMQAgARuPCUW8wRE\nIoG7A8XCTKb5B+1iB6DCTtA6OwOMp/jpMBZg+e9K6Vp3V/3Mrkv3+et+DY0s\n9t13sf3jUFs9z7vYd4aW1mqrDrJPw1IfsNql4G99Qx8Eo7HGRbzWgIKQDlMm\nwX9rDAnwgRGH+hBhm29hpuj0HwyRPj6B+7QoTtFK/ltwO3PaxlXoc4KQ7Pgw\n8YiCpcZuhjiM04SLLiMQyLvBIGZqk13AYusbDXBZbFEaFQ0M0O09osKvV8qI\nmDsrzpm/fB4m1oDAaViQduLJ+4R02fYtq1Kkvwq0++CVUEK4bLHCQnNiSwho\nGUCjy8zOLgCDHVkIXO3gO05UkB5KBT8uNZo7QyUWvdYO5G2wCUycSdpApmE5\nQkT1rUA9pWSg3ffaMtTzJw5NHhzXsYIrAZvGIafRtz+6pDVdRP1v6+Lt6gJ4\ng3vp+NKKGR3QSxN89UahV4AIx33hhr5LFwIo5mbR0UZDtdWF78DrASBragjy\nOM49DaEhtm5UEiRzKhiKpbmrPn70m3zx1GPjAKUiJ2dcg2MztyPLZCtmOBlQ\neA4W5xzKyyvjLkb+8b9tyoCrEY7Ptzy03VN6nyTaY8lEvw6PxovieO7yW3Qw\n3GtLZwAg1kPyUxwErwUeAfEArz5+5/uipDGy4I/UTcicJEDqBQke9sqc8RZv\nTcU0\r\n=XaGz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCgNHu6mo6CN/cO4NJUUR7KD6m1CEzN9MGfTJGsfCxajgIhAJA2v650/n0dDfcyKyiWuRuP066c5zTjoAi5zjcokufX"}]},"_npmUser":{"name":"pimterry","email":"pimterry@gmail.com"},"directories":{},"maintainers":[{"name":"pimterry","email":"pimterry@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/proxy-agent_5.0.1-socks-lookup-fix.0_1635883746161_0.5127277104540195"},"_hasShrinkwrap":false}},"time":{"created":"2021-11-02T20:09:06.092Z","5.0.1-socks-lookup-fix.0":"2021-11-02T20:09:06.332Z","modified":"2022-04-05T18:42:08.578Z"},"maintainers":[{"name":"pimterry","email":"pimterry@gmail.com"}],"description":"Maps proxy protocols to `http.Agent` implementations","homepage":"https://github.com/TooTallNate/node-proxy-agent","keywords":["http","https","socks","agent","mapping","proxy","cache"],"repository":{"type":"git","url":"git://github.com/TooTallNate/node-proxy-agent.git"},"author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net","url":"http://n8.io/"},"bugs":{"url":"https://github.com/TooTallNate/node-proxy-agent/issues"},"license":"MIT","readme":"proxy-agent\n===========\n### Maps proxy protocols to `http.Agent` implementations\n[![Build Status](https://travis-ci.org/TooTallNate/node-proxy-agent.svg?branch=master)](https://travis-ci.org/TooTallNate/node-proxy-agent)\n\n_A quick & temporary fork of the proxy-agent package to deploy a [DNS lookup fix](https://github.com/TooTallNate/node-socks-proxy-agent/pull/72) in [HTTP Toolkit](https://httptoolkit.tech)_\n\nThis module provides a function that returns proxying `http.Agent` instances to\nuse based off of a given proxy URI. If no URI is provided, then\n[proxy-from-env](https://www.npmjs.com/package/proxy-from-env) is used to get the URI\nfrom `$HTTP_PROXY`, `$HTTPS_PROXY` and `$NO_PROXY` among others.\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\n\nInstallation\n------------\n\nInstall with `npm`:\n\n``` bash\n$ npm install proxy-agent\n```\n\n\nExample\n-------\n\n``` js\nvar http = require('http');\nvar ProxyAgent = require('proxy-agent');\n\n// HTTP, HTTPS, or SOCKS proxy to use\nvar proxyUri = process.env.http_proxy || 'http://168.63.43.102:3128';\n\nvar opts = {\n  method: 'GET',\n  host: 'jsonip.org',\n  path: '/',\n  // this is the important part!\n  // If no proxyUri is specified, then https://www.npmjs.com/package/proxy-from-env\n  // is used to get the proxyUri.\n  agent: new ProxyAgent(proxyUri)\n};\n\n// the rest works just like any other normal HTTP request\nhttp.get(opts, onresponse);\n\nfunction onresponse (res) {\n  console.log(res.statusCode, res.headers);\n  res.pipe(process.stdout);\n}\n```\n\n\nAPI\n---\n\n### new ProxyAgent(Object|String opts|uri)\n\nReturns an `http.Agent` instance based off of the given proxy `opts` or URI\nstring. An LRU cache is used, so the same `http.Agent` instance will be\nreturned if identical args are passed in.\n\n\nLicense\n-------\n\n(The MIT License)\n\nCopyright (c) 2013 Nathan Rajlich &lt;nathan@tootallnate.net&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n[http-proxy-agent]: https://github.com/TooTallNate/node-http-proxy-agent\n[https-proxy-agent]: https://github.com/TooTallNate/node-https-proxy-agent\n[socks-proxy-agent]: https://github.com/TooTallNate/node-socks-proxy-agent\n[pac-proxy-agent]: https://github.com/TooTallNate/node-pac-proxy-agent\n","readmeFilename":"README.md"}