source: trip-planner-front/node_modules/forwarded/README.md@ 76712b2

Last change on this file since 76712b2 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.6 KB
Line 
1# forwarded
2
3[![NPM Version][npm-image]][npm-url]
4[![NPM Downloads][downloads-image]][downloads-url]
5[![Node.js Version][node-version-image]][node-version-url]
6[![Build Status][ci-image]][ci-url]
7[![Test Coverage][coveralls-image]][coveralls-url]
8
9Parse HTTP X-Forwarded-For header
10
11## Installation
12
13This is a [Node.js](https://nodejs.org/en/) module available through the
14[npm registry](https://www.npmjs.com/). Installation is done using the
15[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
16
17```sh
18$ npm install forwarded
19```
20
21## API
22
23```js
24var forwarded = require('forwarded')
25```
26
27### forwarded(req)
28
29```js
30var addresses = forwarded(req)
31```
32
33Parse the `X-Forwarded-For` header from the request. Returns an array
34of the addresses, including the socket address for the `req`, in reverse
35order (i.e. index `0` is the socket address and the last index is the
36furthest address, typically the end-user).
37
38## Testing
39
40```sh
41$ npm test
42```
43
44## License
45
46[MIT](LICENSE)
47
48[ci-image]: https://badgen.net/github/checks/jshttp/forwarded/master?label=ci
49[ci-url]: https://github.com/jshttp/forwarded/actions?query=workflow%3Aci
50[npm-image]: https://img.shields.io/npm/v/forwarded.svg
51[npm-url]: https://npmjs.org/package/forwarded
52[node-version-image]: https://img.shields.io/node/v/forwarded.svg
53[node-version-url]: https://nodejs.org/en/download/
54[coveralls-image]: https://img.shields.io/coveralls/jshttp/forwarded/master.svg
55[coveralls-url]: https://coveralls.io/r/jshttp/forwarded?branch=master
56[downloads-image]: https://img.shields.io/npm/dm/forwarded.svg
57[downloads-url]: https://npmjs.org/package/forwarded
Note: See TracBrowser for help on using the repository browser.