Closed cwholt closed 11 years ago
note: works for most ip addresses that I can tell, but not the one used in the below example.
setup geoip
var geoip = require("geoip").City; var geoIpCity = new geoip('./lib/geoip/GeoLiteCity20120213.dat'); var ipAddress = "199.182.212.174";
geoIpCity.lookupSync
geoIpCity.lookupSync(ipAddress)
result
{ country_code: 'US', country_code3: 'USA', country_name: 'United States', region: 'IL', city: 'Des Plaines', postal_code: '60018', latitude: 41.998600006103516, longitude: -87.90280151367188, metro_code: 602, dma_code: 602, area_code: 847, continent_code: 'NA', time_zone: 'America/Chicago' }
geoIpCity.lookup
geoIpCity.lookup(ipAddress, function(err, location) { console.log(err, location); })
[Error: Data not found] null
Wired...
Anyway, thank for the report, will checkout ASAP.
Fixed and released new version, v0.4.8.
Please update to it and give a try.
Success. Thanks.
note: works for most ip addresses that I can tell, but not the one used in the below example.
setup geoip
geoIpCity.lookupSync
result
geoIpCity.lookup
result