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 }
func (psl *myPublicSuffixList) PublicSuffix(domain string) string { suffix, _ := publicsuffix.PublicSuffix(domain) return suffix }