In code: p = strings.ToLower(strings.TrimSpace(p)) if len(p) == 0 { continue } if hasPort(p) { p = p[:strings.LastIndex(p, ":")] } if addr == p { return false } if p[0] == '.' && (strings.HasSuffix(addr, p) || addr == p[1:]) { // no_proxy ".foo.com" matches "bar.foo.com" or " foo.com" return false } if p[0] != '.' && strings.HasSuffix(addr, p) && addr[len(addr)-len(p)-1] == '.' { // no_proxy "foo.com" matches "bar.foo.com" return false } if _, net, err := net.ParseCIDR(p); ip != nil && err == nil && net.Contains(ip) { return false } If we wanted to support "*.bar.com" we could add it to the first if with something like: if len(p) > 2 && p[0] == '*' && p[1] == '.' { p = p[1:] } (eg, treat *.com as just .com) On Mon, May 28, 2018 at 8:20 AM, John Meinel