I am using GeoIP to get country from client address but it returns null
ip = (req.headers['x-forwarded-for'] || '').split(',')[0] || req.connection.remoteAddress;
country = geoip.lookup(ip).country;
I think this is because I am using localhost since the detected ip is 127.0.1. How to solve that?