Skip to content
Parse HTTP X-Forwarded-For header
JavaScript
Branch: master
Clone or download

Latest commit

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
benchmark
test Fix trimming leading / trailing OWS Jul 17, 2017
.eslintignore lint: apply standard style Jul 17, 2017
.eslintrc lint: apply standard style Jul 17, 2017
.gitignore
.travis.yml build: support Node.js 10.x Jun 13, 2018
HISTORY.md 0.1.2 Sep 15, 2017
LICENSE docs: update copyright Sep 14, 2017
README.md docs: update Node.js download link Sep 15, 2017
index.js
package.json

README.md

forwarded

NPM Version NPM Downloads Node.js Version Build Status Test Coverage

Parse HTTP X-Forwarded-For header

Installation

This is a Node.js module available through the npm registry. Installation is done using the npm install command:

$ npm install forwarded

API

var forwarded = require('forwarded')

forwarded(req)

var 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

You can’t perform that action at this time.