Skip to content

Commit

Permalink
fixing getting a user's IP address
Browse files Browse the repository at this point in the history
  • Loading branch information
hengkiardo committed May 24, 2014
1 parent 930edd2 commit b408326
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,11 @@ app.get('/country/region', function (req, res, next) {


app.get('/', function (req, res, next) {
var ip = req.ip
|| req.headers['x-forwarded-for']
var ip = req.headers['x-forwarded-for']
|| req.connection.remoteAddress
|| req.socket.remoteAddress
|| req.connection.socket.remoteAddress;

// console.log(ip);

var ip_lookup = geoip.lookup(ip);

if(ip_lookup !== null) {
Expand Down

0 comments on commit b408326

Please sign in to comment.