コード例 #1
0
ファイル: filter.go プロジェクト: zhouruiapple/namebench
func isPossiblyInternal(addr string) bool {
	// note: this happens to reject IPs and anything with a port at the end.
	_, icann := publicsuffix.PublicSuffix(addr)
	if !icann {
		log.Printf("%s does not have a public suffix", addr)
		return true
	}
	if internal_re.MatchString(addr) {
		log.Printf("%s may be internal.", addr)
		return true
	}
	return false
}
コード例 #2
0
ファイル: cookiejar.go プロジェクト: firememory/evilboy
func (psl *myPublicSuffixList) PublicSuffix(domain string) string {
	suffix, _ := publicsuffix.PublicSuffix(domain)
	return suffix
}