When you configure a http.Client in Go with a HTTP proxy, how does Go handle the DNS request?
I suspect that the name resolved is locally, then the request is proxied.
Is that correct? Or is the DNS request also somehow proxied through?
proxiedClient := &http.Client{
Transport: &http.Transport{
Proxy: http.ProxyURL(proxyURL),
},
}
>Solution :
DNS is done locally, unless a DNS library is used within the code to explicitly do the DNS queries in a non-local behavior.
Once the hostname is resolved by DNS (usually locally), then http.Client can be used to proxy the actual HTTP/S request