kuno / GeoIP

GeoIP binding for nodejs(>=0.10) and iojs
GNU Lesser General Public License v2.1
414 stars 129 forks source link

geoip::City::lookup returns "Data not found" when geoip::City::lookupSync works correctly #51

Closed cwholt closed 11 years ago

cwholt commented 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);
})

result

[Error: Data not found] null
kuno commented 11 years ago

Wired...

Anyway, thank for the report, will checkout ASAP.

kuno commented 11 years ago

Fixed and released new version, v0.4.8.

Please update to it and give a try.

cwholt commented 11 years ago

Success. Thanks.