diff --git a/internal/app.go b/internal/app.go index ef2e9c8..228d278 100644 --- a/internal/app.go +++ b/internal/app.go @@ -56,7 +56,7 @@ func MainApp(configPath string) { if config.ShouldForceIPv6() { ipv6List, err = hosts.FetchHosts(hosts.IPV6) if err != nil { - panic(err) + zurglog.Warnf("Failed to fetch IPv6 hosts: %v", err) } } downloadClient := http.NewHTTPClient(config.GetToken(), config.GetRetriesUntilFailed(), 0, ipv6List, config, log.Named("dlclient")) diff --git a/pkg/http/client.go b/pkg/http/client.go index a74b5b6..1ae852b 100644 --- a/pkg/http/client.go +++ b/pkg/http/client.go @@ -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