gogeoip2

command module
v0.0.0-...-531259d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 12, 2016 License: MIT Imports: 7 Imported by: 0

README

gogeoip2

Gitter

gogeoip2 is a Go-based IP lookup tool which provides geographic metadata for an IPv4 address in it's simplest form. It can also be extended (with a premium database) to provide ISP information (i.e. ASN and ISP name)

This data allows one to make informed decisions about who owns IP addresses/network blocks. This tool was used at HotelTonight to make decisions about automatically blocking traffic using a scoring algorithm based on network reputation.

A demo service is currently hosted (and rate-limitted) at http://geo.srv.im — hosted on Docker by Hyper!

Example Output
~  % curl -s "http://geo.srv.im/ip/173.247.196.18?lat=35.0&lng=-120.0" | jq .
{
  "ip": "173.247.196.18",
  "asnum": 19165,
  "city": "San Francisco",
  "country": "United States",
  "country-iso": "US",
  "continent": "NA",
  "lat": 37.7758,
  "lng": -122.4128,
  "time-zone": "America/Los_Angeles",
  "distance": 376.6809639080358,
  "hostnames": [
    "x.196.247.173.web-pass.com."
  ],
  "asorg": "Webpass Inc.",
  "isp": "Webpass",
  "org": "Webpass",
  "cidr-report": "http://www.cidr-report.org/cgi-bin/as-report?as=AS19165&view=2.0",
  "cleantalk-report": "https://cleantalk.org/blacklists/AS19165",
  "ipinfo-report": "http://ipinfo.io/AS19165",
  "peering-db-report": "https://beta.peeringdb.com/api/asn/19165"
}
Running Locally
  1. Download the MaxMind GeoLite2 City database and place it in the root directory.
  2. (optional) Purchase and download the GeoIP2 ISP database and put it in the root directory.
  3. Grab the build dependencies using go get -v ./... from the root directory.
  4. Build the package using go build
  5. Run the server using ./gogeoip2 server

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

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL