g-andrade / locus

MMDB reader for geolocation and ASN lookup of IP addresses
https://hexdocs.pm/locus/
MIT License
111 stars 15 forks source link

Locus with IP2Proxy support #40

Closed Zabrane closed 7 months ago

Zabrane commented 8 months ago

Hi @g-andrade

Are you planning to support IP2Proxy detection within Locus? By the way, Locus is very useful for us. Big thanks

g-andrade commented 8 months ago

Hi @Zabrane, sleek website!

I’d like for locus to support any MMDB database - 50% of it because I really like the wire format and spec, the other 50 because it was the right time and place for me back when I did the bulk of the work and it matched what I needed for my job.

So, if it’s MMDB format, maybe - if not, I’ve scratched that itch already (I skimmed the website, I’m sorry if it obviously is or isn’t and I missed it.)

All of that having been said: this library was a pet project all along, and I’ve moved onto other things. Let me know if your proposal is a simple extension of what ‘locus’ already does.

Cheers,

Zabrane commented 7 months ago

Hi @g-andrade The IP2Proxy database is available in both CSV in Bin (MMDB) format if I'm not mistaken (see screenshot).

Screenshot_2024-02-07_at_13_23_39

Will you consider supporting IP2Proxy in the future?

g-andrade commented 7 months ago

locus doesn't like the binary format:

Screenshot from 2024-02-18 20-25-31

Their FAQ page mentions that it's a custom binary format - no mention of MMDB - and I didn't find a spec for it.

There is, however, an Erlang module which may fit your needs, although it looks bare bones (not an Erlang app, no rebar3 or other tooling configured, really just the parser): https://www.ip2location.com/development-libraries/ip2location/erlang

g-andrade commented 7 months ago

Also, someone somewhere once wrote a script to convert IP2Proxy databases to MMDB format: https://github.com/fengdelan/convert-ip2proxy-lite-mmdb

(I now realize I tested IP2Location databases earlier - not IP2Proxy - but the later are also not in MMDB format.)

Zabrane commented 7 months ago

@g-andrade Thanks for taking the time on this topic. It's very strange the the 02 databases use different binary formats (not compatible with MMDB). I will try to reach out their support to see what can be done. Keep up the good work @g-andrade