fast-geoip icon indicating copy to clipboard operation
fast-geoip copied to clipboard

IPv6 support

Open Kikobeats opened this issue 3 years ago • 8 comments

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?

Kikobeats avatar Mar 03 '21 22:03 Kikobeats

It's really appreciated how well-designed it is clap

Thanks!

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

:partying_face:, let me know if there's anything on my end that I could do to make your life easier,

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

MaxMind also provides an IPv6 database so it is definitely possible to integrate IPv6 addresses into the package. With that being said, I'd probably make this into a new package in order to keep the size of the current package low enough so that it fits into the lowest-memory lambda.

corollari avatar Mar 04 '21 20:03 corollari

that makes sense; then it can be combined with is-ip in order to determine what fast-geoip should be used!

Kikobeats avatar Mar 04 '21 22:03 Kikobeats

Any updates on IPv6 support? 😄 I’d love to use fast-geoip for my serverless use case, but only node-geoip supports both IPv4 and IPv6. Enjoyed reading the optimization strategies—very cool.

jlarmstrongiv avatar Jun 29 '21 04:06 jlarmstrongiv

that makes sense; then it can be combined with is-ip in order to determine what fast-geoip should be used!

if we need to find out the ip version, we can do it without dependencies.

const Net = require('net');
let version = Net.isIP(ipAdress); // return 4 or 6

sanchezzzhak avatar Jul 12 '21 18:07 sanchezzzhak

Any news about v6?

> geoip.lookup('141.226.15.196').then(r => console.log(r))
> {
  country: 'IL',
  timezone: 'Asia/Jerusalem',
  city: 'Tel Aviv',
}
> geoip.lookup('2a02:ed0:52be:e900:442d:a98c:84a5:6d31').then(r => console.log(r)) -- the same ip in v6
> {
  country: 'FR', 😂
  timezone: 'Europe/Paris',
  city: 'Mamers',
}

Doc999tor avatar Sep 09 '21 19:09 Doc999tor

Any news? IP v6 still dont work properly

maddybo avatar Apr 28 '22 13:04 maddybo

IPv6 support would be incredible :)

emjoseph avatar Jun 01 '23 00:06 emjoseph

We still waiting :D

maddybo avatar Jun 01 '23 08:06 maddybo