Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/floatdrop/express-public-ip

Filter private addresses from req.ips
https://github.com/floatdrop/express-public-ip

Last synced: 22 days ago
JSON representation

Filter private addresses from req.ips

Awesome Lists containing this project

README

        

# express-public-ip [![Build Status](https://travis-ci.org/floatdrop/express-public-ip.svg?branch=master)](https://travis-ci.org/floatdrop/express-public-ip)

> Filter private addresses from req.ips

## Install

```
$ npm install --save express express-public-ip
```

## Usage

```js
var app = require('express')();
var expressPublicIp = require('express-public-ip');

app.enable('trust proxy');

app.use(expressPublicIp());

app.get('/', function (req, res) {
res.send(req.ip);
});
```

## API

### expressPublicIp()

Returns `express-public-ip` middleware function.

## License

MIT © [Vsevolod Strukchinsky](http://github.com/floatdrop)