GODT-1437 Add new proxy provider (Quad9 with port).

This commit is contained in:
Jakub
2022-03-15 17:10:40 +01:00
committed by Jakub Cuth
parent c7eb7234a2
commit 2d5ea669a5
4 changed files with 45 additions and 15 deletions

View File

@ -60,11 +60,16 @@ func formatAsAddress(rawURL string) string {
panic(err)
}
host := url.Host
if host == "" {
host = url.Path
}
port := "443"
if url.Scheme == "http" {
port = "80"
}
return net.JoinHostPort(url.Host, port)
return net.JoinHostPort(host, port)
}
// DialTLS dials the given network/address. If it fails, it retries using a proxy.