@fastify/forwarded
Parse HTTP X-Forwarded-For header
Last updated 4 years ago by matteo.collina .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @fastify/forwarded 
SYNC missed versions from official npm registry.

@fastify/forwarded

CI NPM version neostandard javascript style

Parse HTTP X-Forwarded-For header.

Updated version of the great https://github.com/jshttp/forwarded. Implements https://github.com/jshttp/forwarded/pull/9.

Installation

$ npm i @fastify/forwarded

API

const forwarded = require('@fastify/forwarded')

forwarded(req)

const addresses = forwarded(req)

Parse the X-Forwarded-For header from the request. Returns an array of the addresses, including the socket address for the req, in reverse order (i.e. index 0 is the socket address and the last index is the furthest address, typically the end-user).

Testing

$ npm test

License

MIT

Current Tags

  • 3.0.1                                ...           latest (6 months ago)

7 Versions

  • 3.0.1                                ...           6 months ago
  • 3.0.0                                ...           2 years ago
  • 2.2.0                                ...           3 years ago
  • 2.1.0                                ...           4 years ago
  • 2.0.0                                ...           4 years ago
  • 1.0.0                                ...           5 years ago
  • 0.1.2                                ...           5 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (5)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |