Sha256: 07438c4c25d8a64e08f08c90c02004d0615e293fb80652854bc5349e683374fc

Contents?: true

Size: 1.6 KB

Versions: 34

Compression:

Stored size: 1.6 KB

Contents

# forwarded

[![NPM Version][npm-image]][npm-url]
[![NPM Downloads][downloads-image]][downloads-url]
[![Node.js Version][node-version-image]][node-version-url]
[![Build Status][travis-image]][travis-url]
[![Test Coverage][coveralls-image]][coveralls-url]

Parse HTTP X-Forwarded-For header

## Installation

This is a [Node.js](https://nodejs.org/en/) module available through the
[npm registry](https://www.npmjs.com/). Installation is done using the
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):

```sh
$ npm install forwarded
```

## API

```js
var forwarded = require('forwarded')
```

### forwarded(req)

```js
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

```sh
$ npm test
```

## License

[MIT](LICENSE)

[npm-image]: https://img.shields.io/npm/v/forwarded.svg
[npm-url]: https://npmjs.org/package/forwarded
[node-version-image]: https://img.shields.io/node/v/forwarded.svg
[node-version-url]: https://nodejs.org/en/download/
[travis-image]: https://img.shields.io/travis/jshttp/forwarded/master.svg
[travis-url]: https://travis-ci.org/jshttp/forwarded
[coveralls-image]: https://img.shields.io/coveralls/jshttp/forwarded/master.svg
[coveralls-url]: https://coveralls.io/r/jshttp/forwarded?branch=master
[downloads-image]: https://img.shields.io/npm/dm/forwarded.svg
[downloads-url]: https://npmjs.org/package/forwarded

Version data entries

34 entries across 33 versions & 12 rubygems

Version Path
optimacms-0.1.61 spec/dummy/node_modules/forwarded/README.md
disco_app-0.18.0 test/dummy/node_modules/forwarded/README.md
disco_app-0.18.2 test/dummy/node_modules/forwarded/README.md
disco_app-0.16.1 test/dummy/node_modules/forwarded/README.md
disco_app-0.15.2 test/dummy/node_modules/forwarded/README.md
disco_app-0.18.4 test/dummy/node_modules/forwarded/README.md
disco_app-0.18.1 test/dummy/node_modules/forwarded/README.md
disco_app-0.12.7.pre.puma.pre.3 test/dummy/node_modules/forwarded/README.md
disco_app-0.14.0 test/dummy/node_modules/forwarded/README.md
disco_app-0.13.6.pre.puma.pre.3 test/dummy/node_modules/forwarded/README.md
tang-0.2.1 spec/tang_app/node_modules/forwarded/README.md
groonga-client-model-6.0.0 test/apps/rails6.0.3.5/node_modules/forwarded/README.md
groonga-client-model-6.0.0 test/apps/rails6.1.3/node_modules/forwarded/README.md
ruby2js-4.0.4 lib/tasks/testrails/node_modules/forwarded/README.md
ruby2js-4.0.3 lib/tasks/testrails/node_modules/forwarded/README.md
tang-0.2.0 spec/tang_app/node_modules/forwarded/README.md
tang-0.1.0 spec/tang_app/node_modules/forwarded/README.md
tang-0.0.9 spec/tang_app/node_modules/forwarded/README.md
enju_library-0.3.8 spec/dummy/node_modules/forwarded/README.md
ilog-0.4.1 node_modules/forwarded/README.md