Documentation ¶
Index ¶
- Constants
- Variables
- func BytesToIPv4(buf []byte) string
- func BytesToIPv6(buf []byte) string
- func IPAddressToInteger(ip string) int
- func IPInLookupTable(ip string, table [][]uint32) bool
- func IsChineseIP(ip string) bool
- func IsChineseWebsite(host string) bool
- func IsPrivateIP(ip string) bool
- func LoadOrCreateChinaList(raw string) bool
- func LookupIPv4(host string) (string, error)
- type China_list_t
Constants ¶
View Source
const (
PRIVATE_IP = `10.0.0.0 10.255.255.255
172.16.0.0 172.31.255.255
192.168.0.0 192.168.255.255`
)
Variables ¶
View Source
var (
CHN_IP = `` /* 211955-byte string literal not displayed */
)
View Source
var IPv4LookupTable [][]uint32
View Source
var IPv4PrivateLookupTable [][]uint32
Functions ¶
func BytesToIPv4 ¶
func BytesToIPv6 ¶
func IPAddressToInteger ¶
func IPInLookupTable ¶
func IsChineseIP ¶
func IsChineseWebsite ¶
Exceptions are those Chinese websites who have oversea servers or CDNs, if you lookup their IPs outside China, you get foreign IPs based on your VPS's geolocation, which are of course undesired results. Using white list to filter these exceptions
func IsPrivateIP ¶
func LoadOrCreateChinaList ¶
func LookupIPv4 ¶ added in v1.0.10
Types ¶
Click to show internal directories.
Click to hide internal directories.