Skip to content

Small server written in Go that responds with GeoIP data for given IP in chosen format (xml/json/html)

License

Notifications You must be signed in to change notification settings

3fs/geoip-lookup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

geoip-lookup

Small server written in Go that responds with GeoIP data for given IP in chosen format (xml/json/html)

Build Status

This product includes GeoLite2 data created by MaxMind, available from http://www.maxmind.com.

Development environment built using https://github.com/FreakyDazio/vagrant-golang.

Project setup instructions

  1. Clone this repository git clone [email protected]:3fs/geoip-lookup.git.
  2. Move to geoip-lookup directory cd geoip-lookup.
  3. Run vagrant up to start development environment.
  4. Run vagrant provision to add all dependencies.
  5. Connect to host via vagrant ssh.
  6. Move to /vagrant directory via cd /vagrant.
  7. Setup and run project with . build.sh.
  8. Go to http://192.168.33.10:8080 to see it in action.
  9. Server can be started anytime by using command geoip-lookupd.
  10. Default port number is 8080. However, port number can be set using first argument of command. Example: geoip-lookupd 3333.

Usage

Any IP can be queried via URL: http://192.168.33.10:8080/{IP}/{format}. Response can be returned in HTML, JSON or XML format

If IP is not provided in URL, IP from RemoteAddr is used (visitor's IP).

About

Small server written in Go that responds with GeoIP data for given IP in chosen format (xml/json/html)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published