addr
Get the remote address of a request, with reverse-proxy support
Usage
$ npm install addr
addr(req, [proxies])
req
: anhttp.ServerRequest
object.proxes
: an array of IP addresses of trusted proxies. If specified and the request doesn't come from one of these addresses, theX-Forwarded-For
header will not be honored.- Returns: Remote IP address of the request, taken from the
X-Forwarded-For
header if it exists and the request is coming from a trusted proxy.
Example
var addr = http = port = 3000 proxies = '127.0.0.1' ; http;
License
MIT