{"versions":{"3.0.0":{"name":"@fastify/proxy-addr","description":"Determine address of proxied request","version":"3.0.0","author":{"name":"Douglas Christopher Wilson","email":"doug@somethingdoug.com"},"license":"MIT","keywords":["ip","proxy","x-forwarded-for"],"repository":{"type":"git","url":"git+https://github.com/fastify/proxy-addr.git"},"dependencies":{"@fastify/forwarded":"^1.0.0","ipaddr.js":"^2.0.0"},"devDependencies":{"beautify-benchmark":"0.2.4","benchmark":"2.1.4","standard":"^16.0.3","tap":"^14.11.0"},"scripts":{"bench":"node benchmark/index.js","test":"standard && tap"},"gitHead":"1ca1ae3cd8cb6f18b4b6fec8194ec5600e7ad7e8","bugs":{"url":"https://github.com/fastify/proxy-addr/issues"},"homepage":"https://github.com/fastify/proxy-addr#readme","_id":"@fastify/proxy-addr@3.0.0","_nodeVersion":"14.15.4","_npmVersion":"6.14.11","_npmUser":{"name":"anonymous","email":"hello@matteocollina.com"},"dist":{"shasum":"7d3bb6474a01b206010329291f4edf6af8af582d","size":4172,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@fastify/proxy-addr/-/proxy-addr-3.0.0.tgz","integrity":"sha512-ty7wnUd/GeSqKTC2Jozsl5xGbnxUnEFC0On2/zPv/8ixywipQmVZwuWvNGnBoitJ2wixwVqofwXNua8j6Y62lQ=="},"directories":{},"maintainers":[{"name":"anonymous","email":"tommydelved@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/proxy-addr_3.0.0_1613153762784_0.6577085370964424"},"_hasShrinkwrap":false,"publish_time":1613153762939,"_cnpm_publish_time":1613153762939,"_cnpmcore_publish_time":"2021-12-16T11:28:32.033Z","contributors":[]},"4.0.0":{"name":"@fastify/proxy-addr","description":"Determine address of proxied request","version":"4.0.0","author":{"name":"Douglas Christopher Wilson","email":"doug@somethingdoug.com"},"license":"MIT","keywords":["ip","proxy","x-forwarded-for"],"repository":{"type":"git","url":"git+https://github.com/fastify/proxy-addr.git"},"bugs":{"url":"https://github.com/fastify/proxy-addr/issues"},"homepage":"https://github.com/fastify/proxy-addr#readme","dependencies":{"@fastify/forwarded":"^2.0.0","ipaddr.js":"^2.0.0"},"devDependencies":{"beautify-benchmark":"0.2.4","benchmark":"2.1.4","standard":"^17.0.0","tap":"^16.0.0"},"scripts":{"bench":"node benchmark/index.js","test":"standard && tap"},"gitHead":"c846304b73239e4aaef95b29c08f43c071e9bd05","_id":"@fastify/proxy-addr@4.0.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-Xt8eu+NAl7rEWQ17B0Hdc0Snhaot2ZXL0c8IKrJBcV4E1jUM2baBiu00vZx9o2DGbV5irfDjcVdaqri/YhwDdw==","shasum":"478938c185835e2e98a4ccdb06e1ba3c957e89b8","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@fastify/proxy-addr/-/proxy-addr-4.0.0.tgz","fileCount":4,"unpackedSize":12089,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDhdhxl8D93t3dmEAhVAbGt98ZekG6lbwaVfSQ9EpkvwAiAOvN4oTJ+pmavuAGY7K6XkBBqafwbXhNW1916pOJzoLg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJijfLAACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpwkxAAoZMmyr7c8aj74Vj238Jf2PAKTaM+wLnVq0x0UlkZn1SCDbNC\r\n8cTt/Lm6uoQjcDXEBMmsGlbUgoVLBFlQwPuqm+oall0FcmswiqEwFs4KPQoV\r\nGB106aTymmiAekDKWSDP2W/X2bLVoiDycEtHPEAi4BrTBvi812OsTMAdwtjr\r\nDzKTvAc13raGzO8/YMpQRgaQucaQOCwvm9OiWoVDN5/pB36UYQYdiBgWYydE\r\nTtsT4NveakRGy084vjMKFcDZ2bdeQtITeqtvsqLqazWug5vt/xpPOS3h74Dv\r\n41oFNIrVn9OeY+LP9RSjRexfW+3opsq1HrCT/SjtisxoWD1pdpMgqJIS29F9\r\nfzwh5SfHqMYe5HeA3RGLisGjA9cDipmpWUQ7VShSvdkneYekKResWbLqPBx9\r\neJxfT06H7JDM7VThtSQGap/BLHuk/OFm57graY8wShpMZtZYoqRylDFf5tEA\r\n3V0iVVRfHoEGRxO6zCQIfxIbLLBwUwdmzVqltz9DRask83M0R0hMColpPTa0\r\nBKqio6nwRTTIRMQlvRgHaJo3II+azuPug9CItoPpx4arYf+rdOz9eI2Cns1x\r\n/E3te8Uiy5JCfpKYFArtGT/CTRNm7HTZIZQZ3fv1EeLxFxPwiizl9S2UOoP9\r\n9IH3XcUGrnyEnMRwM1fdAJuUWT7iLvd86Gs=\r\n=xyja\r\n-----END PGP SIGNATURE-----\r\n","size":4330},"_npmUser":{"name":"anonymous","email":"hello@matteocollina.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"tommydelved@gmail.com"},{"name":"anonymous","email":"hello@matteocollina.com"},{"name":"anonymous","email":"james.sumners@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/proxy-addr_4.0.0_1653469888726_0.58643301527822"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-05-25T10:37:14.949Z","contributors":[]},"4.1.0":{"name":"@fastify/proxy-addr","description":"Determine address of proxied request","version":"4.1.0","main":"index.js","types":"types/index.d.ts","author":{"name":"Douglas Christopher Wilson","email":"doug@somethingdoug.com"},"license":"MIT","keywords":["ip","proxy","x-forwarded-for"],"repository":{"type":"git","url":"git+https://github.com/fastify/proxy-addr.git"},"bugs":{"url":"https://github.com/fastify/proxy-addr/issues"},"homepage":"https://github.com/fastify/proxy-addr#readme","dependencies":{"@fastify/forwarded":"^2.0.0","ipaddr.js":"^2.0.0"},"devDependencies":{"@types/node":"^18.11.11","beautify-benchmark":"0.2.4","benchmark":"2.1.4","standard":"^17.0.0","tap":"^16.0.0","tsd":"^0.25.0"},"scripts":{"bench":"node benchmark/index.js","lint":"standard","test":"npm run test:unit && npm run test:typescript","test:typescript":"tsd","test:unit":"tap"},"gitHead":"db635d606fb368a9d6e4736508fd5cf509c7a332","_id":"@fastify/proxy-addr@4.1.0","_nodeVersion":"16.17.0","_npmVersion":"9.1.2","dist":{"integrity":"sha512-qM7GsdQLojsqv7Ldhn6Ygu9p/9m/uzeAtVReZI7kJ8UzsXXTeHjFe6BzQI4FRCaW2VaZEuZI5W7OF2u0SZn4Lw==","shasum":"511b412693301d50f189e9985b0f01af81ad6730","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@fastify/proxy-addr/-/proxy-addr-4.1.0.tgz","fileCount":18,"unpackedSize":36176,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBvI3dmaMCyCzfgiP2kZt8R7IoyaPADc+jy3ZAzhTa2+AiEA704N+HGFrTvsTVs1UbY6PK1VvbGmapwQfmVwKkUqN1k="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjmxIIACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqY8Q//S9UCDFijyuWrkngoKwYG8p10W8sxmZmdOFwtEAaCOPBEgZoq\r\np6/QPWiAKYNhVBOh6HxCTRrzAaOZAc4pt3W4zHjb9xly5S+3pIlao/sfLh5o\r\nn9XFIR47txSo0KFKaHNhy31lo6dSzPBhT8ZRGy/P4OFmZgWavMCI6eIZh2IR\r\nVnS/qYrp7dG5OeevBNzGy7utrht7dH78h2fHB3w5kAppcvyIfk5DyD7sHShR\r\n320HonW1g+rHAWt3VyZq4lA0n4mJawYwao4o9sjcMdjln54LHxL16feCyQ1h\r\nleYVOzlapZ+4/xfQJqXnRZH1YzRG300R1ug6q09U0ncfSQrFQU1T51Xr0P3h\r\n6WIqDbzNdtrAWmbYZXI1phWv5bUiYgnU8/lvbIyQaVXoufaCfqEfatzR6S3t\r\n7rabHVK5k1EG5OGIUvckbvdsmO6+WexgSaiLNp8ZjPoL8MtF8hKri0EcQqSU\r\n7NLt68P4z5Gx6vLX7diwz2xGsw7UveOUTWjRU3rUxW5pD4gIoehMjGViDhZH\r\nqFipti07BNAZps6qf3KvL2V8NH1aypU76iPWsWZZhAgWQSHnOepoBJJeORDf\r\n0HhNq8N1sSPr6r0/HlgDjpzgzDPvFMnRg7L5iT0plsek7u1C56Yf+5oVqSIN\r\nKIuSdgRJKwFirKF0pT7MR2qKEZlmuB5VPHM=\r\n=xWnh\r\n-----END PGP SIGNATURE-----\r\n","size":8115},"_npmUser":{"name":"anonymous","email":"hello@matteocollina.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"tommydelved@gmail.com"},{"name":"anonymous","email":"hello@matteocollina.com"},{"name":"anonymous","email":"james.sumners@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/proxy-addr_4.1.0_1671107080372_0.9244830690855266"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-12-15T12:50:59.880Z","contributors":[]},"5.0.0-pre.fv5.1":{"name":"@fastify/proxy-addr","description":"Determine address of proxied request","version":"5.0.0-pre.fv5.1","main":"index.js","type":"commonjs","types":"types/index.d.ts","author":{"name":"Douglas Christopher Wilson","email":"doug@somethingdoug.com"},"license":"MIT","keywords":["ip","proxy","x-forwarded-for"],"repository":{"type":"git","url":"git+https://github.com/fastify/proxy-addr.git"},"bugs":{"url":"https://github.com/fastify/proxy-addr/issues"},"homepage":"https://github.com/fastify/proxy-addr#readme","dependencies":{"@fastify/forwarded":"^2.2.0","ipaddr.js":"^2.1.0"},"devDependencies":{"@fastify/pre-commit":"^2.1.0","@types/node":"^20.12.7","beautify-benchmark":"0.2.4","benchmark":"2.1.4","c8":"^7.14.0","standard":"^17.1.0","tape":"^5.7.5","tsd":"^0.31.0"},"scripts":{"bench":"node benchmark/index.js","lint":"standard","lint:fix":"standard --fix","test":"npm run test:unit && npm run test:typescript","test:typescript":"tsd","test:unit":"c8 tape test/**/*.js"},"_id":"@fastify/proxy-addr@5.0.0-pre.fv5.1","readmeFilename":"README.md","gitHead":"e6cf439378027059e18ba1e3bb525f7f5ed31fea","_nodeVersion":"20.14.0","_npmVersion":"10.7.0","dist":{"integrity":"sha512-wjjSEiBJh3Qang60As/90TlPwE/ziiIzEbPtJDCYEeGyRUuR/ZVaz/kKs0PVgWrrD6kHsQVFM7Hf6aRvrVjjWg==","shasum":"730274ba7dea1e6bd18f17bbcefd4db41823ed19","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@fastify/proxy-addr/-/proxy-addr-5.0.0-pre.fv5.1.tgz","fileCount":18,"unpackedSize":36548,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDC+KoOieUzXzAlq076PeD0zKp5cMYvsCP8OyzIP7VfHgIhANbj/KNCVsU89SZjoZ/dhdV/pWb85pFMSsf7UMi9xHTo"}],"size":8294},"_npmUser":{"name":"anonymous","email":"james.sumners@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"tommydelved@gmail.com"},{"name":"anonymous","email":"hello@matteocollina.com"},{"name":"anonymous","email":"james.sumners@gmail.com"},{"name":"anonymous","email":"behemoth89@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/proxy-addr_5.0.0-pre.fv5.1_1718826335932_0.8089826996114657"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-06-19T19:45:36.112Z","publish_time":1718826336112,"_source_registry_name":"default","contributors":[]},"5.0.0":{"name":"@fastify/proxy-addr","version":"5.0.0","keywords":["ip","proxy","x-forwarded-for"],"author":{"name":"Douglas Christopher Wilson","email":"doug@somethingdoug.com"},"license":"MIT","_id":"@fastify/proxy-addr@5.0.0","maintainers":[{"name":"anonymous","email":"tommydelved@gmail.com"},{"name":"anonymous","email":"hello@matteocollina.com"},{"name":"anonymous","email":"james.sumners@gmail.com"},{"name":"anonymous","email":"behemoth89@gmail.com"}],"homepage":"https://github.com/fastify/proxy-addr#readme","bugs":{"url":"https://github.com/fastify/proxy-addr/issues"},"dist":{"shasum":"e9d1c7a49b8380d9f92a879fdc623ac47ee27de3","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@fastify/proxy-addr/-/proxy-addr-5.0.0.tgz","fileCount":18,"integrity":"sha512-37qVVA1qZ5sgH7KpHkkC4z9SK6StIsIcOmpjvMPXNb3vx2GQxhZocogVYbr2PbbeLCQxYIPDok307xEvRZOzGA==","signatures":[{"sig":"MEQCICFMKE20YkQC8cg1QKnYZ27Pe4BBrsVA4H+PEz7CFh23AiBiMO6e9PwptCw0crdNO7Q4g8ouddWbKWxxr+dh5burAA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":36531,"size":8280},"main":"index.js","type":"commonjs","types":"types/index.d.ts","gitHead":"5602b6f4c043e0e6dbb815da77f72819763c9fd2","scripts":{"lint":"standard","test":"npm run test:unit && npm run test:typescript","bench":"node benchmark/index.js","lint:fix":"standard --fix","test:unit":"c8 tape test/**/*.js","test:typescript":"tsd"},"_npmUser":{"name":"anonymous","email":"hello@matteocollina.com"},"repository":{"url":"git+https://github.com/fastify/proxy-addr.git","type":"git"},"_npmVersion":"10.8.1","description":"Determine address of proxied request","directories":{},"_nodeVersion":"20.16.0","dependencies":{"ipaddr.js":"^2.1.0","@fastify/forwarded":"^3.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"c8":"^7.14.0","tsd":"^0.31.0","tape":"^5.7.5","standard":"^17.1.0","benchmark":"2.1.4","@types/node":"^22.0.0","beautify-benchmark":"0.2.4","@fastify/pre-commit":"^2.1.0"},"_npmOperationalInternal":{"tmp":"tmp/proxy-addr_5.0.0_1725437246620_0.3418155684548261","host":"s3://npm-registry-packages"},"_cnpmcore_publish_time":"2024-09-04T08:07:26.856Z","publish_time":1725437246856,"_source_registry_name":"default","contributors":[]},"5.1.0":{"name":"@fastify/proxy-addr","description":"Determine the address of a proxied request","version":"5.1.0","main":"index.js","type":"commonjs","types":"types/index.d.ts","author":{"name":"Douglas Christopher Wilson","email":"doug@somethingdoug.com"},"contributors":[{"name":"Matteo Collina","email":"hello@matteocollina.com"},{"name":"Aras Abbasi","email":"aras.abbasi@gmail.com"},{"name":"James Sumners","url":"https://james.sumners.info"},{"name":"Frazer Smith","email":"frazer.dev@icloud.com","url":"https://github.com/fdawgs"}],"license":"MIT","keywords":["ip","proxy","x-forwarded-for"],"repository":{"type":"git","url":"git+https://github.com/fastify/proxy-addr.git"},"bugs":{"url":"https://github.com/fastify/proxy-addr/issues"},"homepage":"https://github.com/fastify/proxy-addr#readme","funding":[{"type":"github","url":"https://github.com/sponsors/fastify"},{"type":"opencollective","url":"https://opencollective.com/fastify"}],"dependencies":{"@fastify/forwarded":"^3.0.0","ipaddr.js":"^2.1.0"},"devDependencies":{"@types/node":"^24.0.8","beautify-benchmark":"0.2.4","benchmark":"2.1.4","c8":"^10.1.2","eslint":"^9.17.0","neostandard":"^0.12.0","tsd":"^0.32.0"},"scripts":{"bench":"node benchmark/index.js","lint":"eslint","lint:fix":"eslint --fix","test":"npm run test:unit && npm run test:typescript","test:typescript":"tsd","test:unit":"c8 --100 node --test"},"_id":"@fastify/proxy-addr@5.1.0","gitHead":"918e32cf3a7502c32d5a8426e42616c74fa34d67","_nodeVersion":"22.19.0","_npmVersion":"10.9.3","dist":{"integrity":"sha512-INS+6gh91cLUjB+PVHfu1UqcB76Sqtpyp7bnL+FYojhjygvOPA9ctiD/JDKsyD9Xgu4hUhCSJBPig/w7duNajw==","shasum":"f5360b5dd83c7de3d41b415be4aab84ae44aa106","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@fastify/proxy-addr/-/proxy-addr-5.1.0.tgz","fileCount":18,"unpackedSize":37777,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIH1fZ2394Z4n+H63WD+AovLcz2hlKY5mQpl4Gh3oPbdLAiAxe3BgNk1U9u86fW/B0AU5P/WNbmzZlLW24E+uNuEAfA=="}],"size":8534},"_npmUser":{"name":"anonymous","email":"behemoth89@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"tommydelved@gmail.com"},{"name":"anonymous","email":"hello@matteocollina.com"},{"name":"anonymous","email":"james.sumners@gmail.com"},{"name":"anonymous","email":"behemoth89@gmail.com"},{"name":"anonymous","email":"kaka@kakawebsitedemo.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/proxy-addr_5.1.0_1759072635900_0.06533958968416509"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-09-28T15:18:44.994Z","publish_time":1759072724994,"_source_registry_name":"default"}},"dist-tags":{"latest":"5.1.0","next":"5.0.0"},"name":"@fastify/proxy-addr","time":{"created":"2022-01-26T23:04:57.871Z","modified":"2025-12-06T21:53:59.589Z","3.0.0":"2021-02-12T18:16:02.939Z","4.0.0":"2022-05-25T09:11:28.877Z","4.1.0":"2022-12-15T12:24:40.640Z","5.0.0-pre.fv5.1":"2024-06-19T19:45:36.112Z","5.0.0":"2024-09-04T08:07:26.856Z","5.1.0":"2025-09-28T15:18:44.994Z"},"readme":"# proxy-addr\n\n[![CI](https://github.com/fastify/proxy-addr/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/fastify/proxy-addr/actions/workflows/ci.yml)\n[![NPM version](https://img.shields.io/npm/v/@fastify/proxy-addr.svg?style=flat)](https://www.npmjs.com/package/@fastify/proxy-addr)\n[![neostandard javascript style](https://img.shields.io/badge/code_style-neostandard-brightgreen?style=flat)](https://github.com/neostandard/neostandard)\n\nDetermine the address of a proxied request.\n\nForked from https://github.com/jshttp/proxy-addr to address https://github.com/jshttp/forwarded/pull/9.\n\n## Install\n\n```sh\n$ npm i @fastify/proxy-addr\n```\n\n## API\n\n<!-- eslint-disable no-unused-vars -->\n\n```js\nconst proxyaddr = require('@fastify/proxy-addr')\n```\n\n### proxyaddr(req, trust)\n\nReturn the address of the request, using the given `trust` parameter.\n\nThe `trust` argument is a function that returns `true` if you trust\nthe address, `false` if you don't. The closest untrusted address is\nreturned.\n\n<!-- eslint-disable no-undef -->\n\n```js\nproxyaddr(req, function (addr) { return addr === '127.0.0.1' })\nproxyaddr(req, function (addr, i) { return i < 1 })\n```\n\nThe `trust` argument may also be a single IP address string or an\narray of trusted addresses, as plain IP addresses, CIDR-formatted\nstrings, or IP/netmask strings.\n\n<!-- eslint-disable no-undef -->\n\n```js\nproxyaddr(req, '127.0.0.1')\nproxyaddr(req, ['127.0.0.0/8', '10.0.0.0/8'])\nproxyaddr(req, ['127.0.0.0/255.0.0.0', '192.168.0.0/255.255.0.0'])\n```\n\nThis module also supports IPv6. Your IPv6 addresses will be normalized\nautomatically (i.e. `fe80::00ed:1` equals `fe80:0:0:0:0:0:ed:1`).\n\n<!-- eslint-disable no-undef -->\n\n```js\nproxyaddr(req, '::1')\nproxyaddr(req, ['::1/128', 'fe80::/10'])\n```\n\nThis module will automatically work with IPv4-mapped IPv6 addresses\nas well to support node.js in IPv6-only mode. This means that you do\nnot have to specify both `::ffff:a00:1` and `10.0.0.1`.\n\nAs a convenience, this module also takes certain pre-defined names\nin addition to IP addresses, which expand into IP addresses:\n\n<!-- eslint-disable no-undef -->\n\n```js\nproxyaddr(req, 'loopback')\nproxyaddr(req, ['loopback', 'fc00:ac:1ab5:fff::1/64'])\n```\n\n  * `loopback`: IPv4 and IPv6 loopback addresses (like `::1` and\n    `127.0.0.1`).\n  * `linklocal`: IPv4 and IPv6 link-local addresses (like\n    `fe80::1:1:1:1` and `169.254.0.1`).\n  * `uniquelocal`: IPv4 private addresses and IPv6 unique-local\n    addresses (like `fc00:ac:1ab5:fff::1` and `192.168.0.1`).\n\nWhen `trust` is specified as a function, it will be called for each\naddress to determine if it is a trusted address. The function is\ngiven two arguments: `addr` and `i`, where `addr` is a string of\nthe address to check and `i` is a number that represents the distance\nfrom the socket address.\n\n### proxyaddr.all(req, [trust])\n\nReturn all the request addresses, optionally stopping at the\nfirst untrusted. This array is ordered from closest to furthest\n(i.e. `arr[0] === req.connection.remoteAddress`).\n\n<!-- eslint-disable no-undef -->\n\n```js\nproxyaddr.all(req)\n```\n\nThe optional `trust` argument takes the same arguments as `trust`\ndoes in `proxyaddr(req, trust)`.\n\n<!-- eslint-disable no-undef -->\n\n```js\nproxyaddr.all(req, 'loopback')\n```\n\n### proxyaddr.compile(val)\n\nCompiles argument `val` into a `trust` function. This function takes\nthe same arguments as `trust` does in `proxyaddr(req, trust)` and\nreturns a function suitable for `proxyaddr(req, trust)`.\n\n<!-- eslint-disable no-undef, no-unused-vars -->\n\n```js\nconst trust = proxyaddr.compile('loopback')\nconst addr = proxyaddr(req, trust)\n```\n\nThis function is meant to be optimized for use against every request.\nIt is recommended that a trust function be compiled up-front for the\ntrusted configuration and passed to proxyaddr(req, trust) for each request.\n\n## Testing\n\n```sh\n$ npm test\n```\n\n## Benchmarks\n\n```sh\n$ npm run bench\n```\n\n## License\n\nLicensed under [MIT](./LICENSE).","users":{}}