https://github.com/primaryobjects/remoteip
A simple method for getting the client IP address for the remote browser in node.js.
https://github.com/primaryobjects/remoteip
Last synced: 10 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
- Owner: primaryobjects
- License: mit
- Created: 2013-04-22T13:31:53.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2013-04-22T13:37:17.000Z (almost 13 years ago)
- Last Synced: 2025-03-11T16:49:29.413Z (11 months ago)
- Language: JavaScript
- Size: 105 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
RemoteIP
--------
A simple method for getting the client IP address for the remote browser.
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.
## Source
https://github.com/primaryobjects/remoteip
## Author
Kory Becker
http://www.primaryobjects.com