Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bohlander/geoipmq
GeoIP resolution over ZeroMQ
https://github.com/bohlander/geoipmq
Last synced: 4 months ago
JSON representation
GeoIP resolution over ZeroMQ
- Host: GitHub
- URL: https://github.com/bohlander/geoipmq
- Owner: bohlander
- License: mit
- Created: 2010-11-06T21:37:44.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2010-11-08T00:22:13.000Z (over 14 years ago)
- Last Synced: 2024-08-01T13:22:24.472Z (7 months ago)
- Language: C
- Homepage:
- Size: 89.8 KB
- Stars: 35
- Watchers: 3
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README
- License: LICENSE
Awesome Lists containing this project
README
geoipmq
---This is a simple service for resolving an ip address to its geographic location. It's basically just a ZeroMQ front end for the MaxMind GeoIP library.
It supports a single command over a ZeroMQ request/response socket:
geoip ip_addr
The response is tab delimited geo information, in the following order:
Country
Region (aka State)
City
Postal Code
Latitude
Longitude
Metro Code
Area CodeAn exmaple response:
US TX Longview 75605 32.583199 -94.714798 709 903Note that any field may be returned as (null).
Installation
---1. Install ZeroMQ per http://www.zeromq.org/intro:get-the-software
2. Install MaxMind's GeoIP C libraries per: http://www.maxmind.com/app/c
3. Build geoipmq:
gcc main.c -lzmq -lGeoIP -o geoipmqRunning
--
To use geoipmq, you need to obtain a copy of MaxMind's free GeoLite city database. This is available here:http://www.maxmind.com/app/geolitecity
Currently MaxMind claims a 79% accuracy at the city level for the free database. For better accuracy you can upgrade to the paid version -- it should be a drop in replacement.
Once you have a city database, start up as:
geoipmq geoipdb port
And you're ready to go.