Skip to content

stephenhenderson/ip-to-city-java8

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ip for City

Simple web-service to find an ipv4 address which resolves to a given city name using the Maxmind geolite2 city geoip datasets. Essentially provides a reverse mapping of a regular maxmind lookup which returns the geo-location for a given ip address.

Notes

I previously wrote a version of the same service in python to get some practical experience in writing an end-to-end webapp while learning the language. I rewrote it here in java for similar reasons, particularly to get practical experience with the new language features added in java 8 (lambdas, nio updates, etc.) and to try out some recent java web-containers like dropwizard.

Running

  • Download and extract the latest maxmind csv data files from here.
  • Update ip-for-city.yml with the paths to the blocks and location files.
  • Build the app with maven: mvn clean install - generates a 'fat jar' ip-for-city-<VERSION>.jar in target/
  • Run as java -jar target/ip-for-city-VERSION>.jar server ip-for-city.yml

About

Reverse geo-ip lookup webservice (find ip address for a city)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages