Fix ipv6 stuffs 2
This commit is contained in:
@@ -127,14 +127,16 @@ func NewHTTPClient(token string, maxRetries int, timeoutSecs int, restrictToHost
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
log.Warnf("Host %s is not an IPv6 host, replacing with a random host (ensure you have preferred_hosts properly set in your config.yml)", host)
|
||||
log.Warnf("Host %s is not an IPv6 host (ensure you have preferred_hosts properly set in your config.yml, if unset, run `zurg network-test -t ipv6`)", host)
|
||||
// replace with a random ipv6 host
|
||||
restrictToHostsLen := len(restrictToHosts)
|
||||
randomHost := restrictToHosts[rand.Intn(restrictToHostsLen)]
|
||||
host = randomHost
|
||||
log.Warnf("Replacing with a random IPv6 host: %s", host)
|
||||
address = net.JoinHostPort(host, port)
|
||||
}
|
||||
}
|
||||
// todo: replace .com with .cloud if needed
|
||||
ips, err := net.DefaultResolver.LookupIPAddr(ctx, host)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user