https://github.com/primaryobjects/remoteip-demo
A simple method for getting the client IP address for the remote browser in node.js.
https://github.com/primaryobjects/remoteip-demo
Last synced: 3 months ago
JSON representation
A simple method for getting the client IP address for the remote browser in node.js.
- Host: GitHub
- URL: https://github.com/primaryobjects/remoteip-demo
- Owner: primaryobjects
- Created: 2013-04-22T13:28:27.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2013-04-22T13:50:12.000Z (almost 13 years ago)
- Last Synced: 2024-10-29T22:50:28.763Z (about 1 year ago)
- Language: JavaScript
- Size: 152 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
RemoteIP
--------
A simple method for getting the client IP address for the remote browser in node.js.
Demo @ http://remoteip.herokuapp.com
```bash
$ npm install remoteip
```
## Usage
```
var remoteip = require('remoteip');
// Get the IP address for the user.
var ipAddress = remoteip.get(req);
```
## Notes
The client IP address is determined by the following:
1. Check the x-forwarded-for HTTP header for a remote IP address.
2. Check the req.connection.remoteAddress property.
## Author
Kory Becker
http://www.primaryobjects.com