-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Geoip not returning city data #53
Comments
thank your report. Will take a look ASAP. |
I saw you are on node 0.6.x. If possible, please update to node 0.8.x, the support for node 0.6.x is now been obsoleted |
Thank you Kunno, let me upgrade node to 0.8.x |
Hi Kunno, now I have node v0.8.6, however I see same issue. Thank you. |
Do you use the latest city data from maxmind? Because the city.lookupSync method is works me without any problem if I provided the valid ipv4 address to it. |
Hi Kuno, I have latest city data file from maxmind. req.header('X-Forwarded-For') also gives me correct IP address. I also noticed some of IPs are getting city code and some are not. What I found is with certain IP addresses city.lookupSync does not return city data. Thank you. |
Can you give me some example ip address that didn't return data? |
try this one : 50.152.210.240 |
it return some data on my machine > city.lookupSync('50.152.210.240');
{ country_code: 'US',
country_code3: 'USA',
country_name: 'United States',
latitude: 38,
longitude: -97,
continent_code: 'NA' }
> |
right, I get same data but it does not have city data |
this is a normal situation, it turns out that for some ip addresses the maxmind's city database is not accurate enough to have the actual info about city. this is normal for free version db, not sure the situation in commercial version. |
Thank you Kuno. Strange thing is it was showing city fine for some time and suddenly stopped. |
Done. |
Hello,,
I am using GeoIp in my node application . It was working fine but since last couple weeks stops returning city data. There was no code change I can recall.
nodejs code :
var geoip = require('../lib/geoip.js');
var geoip = require('geoip');
var City = geoip.City;
var city = new City('/site/node_modules/geoip/deps/GeoIP-1.4.8/data/GeoLiteCity.dat');
var city_obj = city.lookupSync(req.header('X-Forwarded-For'));
console.log(city_obj);
{ country_code: 'US',
country_code3: 'USA',
country_name: 'United States',
latitude: 38,
longitude: -97,
continent_code: 'NA' }
node -v
v0.6.18
Thank you,
WG
The text was updated successfully, but these errors were encountered: