{"name":"proxy","version":"2.0.0","keywords":["http","https","proxy","connect","tunnel","squid","privoxy","apache","mod_proxy","via","x-forwarded-for"],"author":{"url":"http://n8.io/","name":"Nathan Rajlich","email":"nathan@tootallnate.net"},"license":"MIT","_id":"proxy@2.0.0","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":"99ac8ba6d5ae137d2b9e2693e927ac7562d1ea02","tarball":"http://registry-npm.ywwl.com/proxy/download/proxy-2.0.0.tgz","fileCount":15,"integrity":"sha512-miY/0MGcDYlY+qPmeDRkxPp3VeonR1+NhuWSYH4dFGzNGbW+3hVH9U0J5SeyJke53g24LbKixkI4jv8QUYU7GQ==","signatures":[{"sig":"MEUCIDU2Fqpx9Y7KSVc5CaQSAKwuX8Zqt2M+xh0ztk1/CCUzAiEAg5PIfuHeEa879N4gHa0XMZ5wUIa/1pj3xttz1zFc928=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":51008,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkVBaPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpcew/9ET0HjWNmq+OarmnhrUzOKMHD3Vz2ewglPgeZ3b94cHWlYZLH\r\nRP46y6XUQHPTK5LArIBZ1sJm/f94KepL7ZBlkd7VwdZzu2THd7+j6w+Hsx/3\r\nzRu/7FSHwvpdLffZslDhvjGfNmKekAwkjT1EVQR5JhI/2suBxUEa4bS6TxRh\r\njMT32Tgx7a3AUkhA+QxCeuOLSjyzw85W5ERhhga/pvWeF/4OJcfdGw1vJnqa\r\nJFh65x15fe4vyY69D/HG82258tvpYbVb9krMw2gb4A8QOzHxlDOpdPb7egms\r\nmKK6ajgtdWsJFKJ3o/N5SsI9/+2BhjMe4dWFx3UgtulEWn0ok2xdrhtWavnb\r\nJXlzSFM2YAfqIB6NGz2f3La/DKfMNhZjyf5tXhX5IK0kpuDeJ9S/CUBa2TSO\r\nbnyp/GOtTuo0Nm4A8VGUEopGXYz2AnfRpJm6pEDdqPOiJ4FaeFW7sUcPGil5\r\nOXFYRxR1/Jz8sVJRhtYsSjIZm1HNZp706jWWvreEggtdGwvYneLk4t4nvRzZ\r\nrIwWGPBykT2IOFoXCZqpUTkMomb4+lDj2WD5HIGM/2/JWjjFvJBvQjZ9OPmK\r\nHh0R2h6TxP5cy1pVht8gPX3g73tm9wrT8ZPvpk8ZFk8nhW+JRIZAIIwLOH1h\r\nzuylbb82UhnkVKUA9D9TNsKVHQVos2vnIPE=\r\n=yDSm\r\n-----END PGP SIGNATURE-----\r\n","size":11497,"noattachment":false,"key":"/proxy/-/proxy-2.0.0.tgz"},"main":"./dist/proxy.js","_from":"file:proxy-2.0.0.tgz","types":"./dist/proxy.d.ts","engines":{"node":">= 14"},"scripts":{"lint":"eslint . --ext .ts","pack":"node ../../scripts/pack.mjs","test":"jest --env node --verbose --bail","build":"tsc"},"_npmUser":{"name":"tootallnate","email":"nathan@tootallnate.net"},"_resolved":"/tmp/f1a9a2d09b0954f13960c78a4ae5d547/proxy-2.0.0.tgz","_integrity":"sha512-miY/0MGcDYlY+qPmeDRkxPp3VeonR1+NhuWSYH4dFGzNGbW+3hVH9U0J5SeyJke53g24LbKixkI4jv8QUYU7GQ==","repository":{"url":"git+https://github.com/TooTallNate/proxy-agents.git","type":"git","directory":"packages/proxy"},"_npmVersion":"9.6.4","description":"An HTTP proxy written with Node.js (think Squid)","directories":{},"_nodeVersion":"20.1.0","dependencies":{"args":"^5.0.3","debug":"^4.3.4","basic-auth-parser":"0.0.2-1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.5.0","ts-jest":"^29.1.0","tsconfig":"0.0.0","typescript":"^5.0.4","@types/args":"^5.0.0","@types/jest":"^29.5.1","@types/node":"^14.18.43","@types/debug":"^4.1.7","async-listen":"^2.1.0"},"_npmOperationalInternal":{"tmp":"tmp/proxy_2.0.0_1683232399651_0.5090903418590718","host":"s3://npm-registry-packages"},"readme":"proxy\n=====\n### An HTTP proxy written with Node.js (think Squid)\n\nThis module provides standard \"HTTP proxy\" logic. You can script your own server\nusing the `proxy` server API. Be sure to take a look at the \"Examples\" section\nbelow.\n\nThere is also a companion `proxy(1)` CLI tool, which spawns an HTTP(s) proxy\nserver with the specified options.\n\nYou could think of `proxy(1)` as similar to some of the other popular open\nsource HTTP proxy software:\n\n * [Squid][]\n * [Privoxy][]\n * [Apache][] with [`mod_proxy`][mod_proxy]\n * [More…](http://wikipedia.org/wiki/Proxy_server#Web_proxy_servers)\n\nExamples\n--------\n\n#### Basic HTTP(s) proxy server\n\nA basic HTTP(s) server with all the default options. All requests are allowed.\nCONNECT HTTP method works as well.\n\n```ts\nimport * as http from 'http';\nimport { createProxy } from 'proxy';\n\nconst server = createProxy(http.createServer());\nserver.listen(3128, () => {\n  var port = server.address().port;\n  console.log('HTTP(s) proxy server listening on port %d', port);\n});\n```\n\n\nCLI Tool Examples\n-----------------\n\nThe `proxy(1)` CLI tool can be used to spawn HTTP(s) proxy server instances with\nvarious options.\n\n#### Port to bind to\n\nPass the `-p`/`--port` option to with a port number to specify a TCP port to\nbind to. Defaults to __3128__ if none is specified.\n\n``` bash\n$ proxy --port 8080\n```\n\n#### Custom `Proxy-Authenticate` command\n\nPass the `-a`/`--authenticate` switch with a command to execute when the client\n`Proxy-Authorization` header is given. This command determines whether or not the\nrequest is authorized based on the \"exit code\" of the command.\n\nThe relevant request authentication information is passed in as\n`PROXY_AUTH_USERNAME`, `PROXY_AUTH_PASSWORD` and `PROXY_AUTH_SCHEME` environment\nvariables.\n\nFor example, to authorize \"Basic\" authentication with username \"foo\" and\npassword \"bar\":\n\n``` bash\n$ proxy --authenticate 'if \\\n    [ \"$PROXY_AUTH_USERNAME\" = \"foo\" ] && \\\n    [ \"$PROXY_AUTH_PASSWORD\" = \"bar\" ]; \\\n      then exit 0; \\\n    fi; \\\n    exit 1;'\n```\n\n#### Custom outgoing interface\n\nPass the `-l`/`--local-address` argument with an IP address of the network\ninterface to send the outgoing requests through. It is the equivalent of setting\na `localAddress` field in the options when calling `http.request()`.\n\n``` bash\n$ proxy --local-address 192.168.0.10\n```\n\n[Squid]: http://www.squid-cache.org/\n[Privoxy]: http://www.privoxy.org/\n[Apache]: http://www.apache.org/\n[mod_proxy]: http://httpd.apache.org/docs/current/mod/mod_proxy.html\n","publish_time":1683232399782,"_cnpm_publish_time":1683232399782,"dist-tags":{"latest":"4.1.0"}}