Giter VIP home page Giter VIP logo

fast-geoip's Issues

Wrong data for IP

Hello,

I have a case where the data reported by the lib is not the same as MaxMind's data

The IP 185.212.21.196 is in Spain and the data reported by MaxMind are correct https://www.maxmind.com/en/geoip2-precision-demo

The library works like a charm in version 1.1.56 and is broken since 1.1.57

Thanks for your work

Support for data updates in production environment

So it looks like you're running a github action that downloads the latest maxmind data and publishes a new npm version, weekly?
Can you provide some mechanism for how one could easily update the data in a production environment? other than running 'npm update fast-geoip' on all our servers every night?

Incorrect location information for localhost: 127.0.0.1

For localhost IP address i.e 127.0.0.1, Japan comes as the Country.
Response is given below:

{
	"range": [
		2130444288,
		2147483648
	],
	"country": "JP",
	"region": "",
	"eu": "0",
	"timezone": "Asia/Tokyo",
	"city": "",
	"ll": [
		35.6897,
		139.6895
	],
	"metro": 0,
	"area": 500
}

__dirname undefined

when deploying on edge, __dirname is not defined, also it's said as a best practice to bundle all js in a single file to optimize cold start. hence, the code in here:

const DATA_DIR = path.join(path.dirname(__dirname), "data");

breaks execution of a lambda@edge using this package.

i was wondering if you had any suggestion for a suitable workaround?

Wrong Data

For IPv6 I get different country and also for some IPv4s I get the same error too.

How do I update the maxmind DB ?

Lookups not working correctly

We were looking at replacing our version of geoip-lite with this library, but realized that the results returned from this library are incorrect; using the example IP (207.97.227.239) in the Readme results in the following:

{
  range: [ 3479289856, 3479306240 ],
  country: 'US',
  region: '',
  eu: '0',
  timezone: 'America/Chicago',
  city: '',
  ll: [ 37.751, -97.822 ],
  metro: 0,
  area: 1000
}

Tried this locally, as well as in the RunKit instance with the same result.

Consistent high CPU usage.

Just installed.

There wasn't much increase in memory used. However, on a 1cpu 1gb memory VPS, it's consistently running at 50-80% CPU even when my express app is idle.

In comparison, without fast-geoip, my node application is running at 0.5-1% CPU.

IPv6 support

Hello,

First of all, thanks for this module. It's really appreciated how well-designed it is πŸ‘

I created a module called request-country that essentially uses fast-geoip for getting the country.

I noted the lookup function is referencing IPv4 addresses and I wanted to ask if it is possible to add ipv6 support.

Correct me if I'm wrong but probably that is not possible since MaxMind's GeoLite database is just for IPv4?

Support for NextJS middleware?

Hello! I am using NextJS Middleware and would like to associate basic geo info with IPs and possibly bounce some IPs based on their location. It seems the NextJS Middleware API surface is limited compared to pure Node and as such neither geoip-lite nor fast-geoip work there. Would you consider adding support for Next Middleware? I am not even sure it would be technically feasible, just checking to see if you've thought about this before in case you are a Next user.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.