Skip to content
/ ip2proxy Public

IP2Location.com Proxy database parser for Golang

License

Notifications You must be signed in to change notification settings

etf1/ip2proxy

Repository files navigation

ip2proxy

IP2Location.com Proxy database parser for Golang

Build Status Go Report Card GoDoc

Install & prerequisites

  • Get the library:
go get -u github.com/etf1/ip2proxy

Use it

package main

import (
	"github.com/etf1/ip2proxy"
)

// let's go !
func main() {
	db, err := ip2proxy.Open("/where/you/unzipped/IP2PROXY-LITE-PX4.BIN")
	if err != nil {
		panic(err)
	}
	res, err := db.LookupIPV4Dot("2.7.154.188")
	if err != nil {
		panic(err)
	}
	if res.Proxy == ip2proxy.ProxyTOR {
		println("2.7.154.188 is a TOR output node !")
	} else {
	    println("2.7.154.188 is NOT a TOR output node")	
	}
}