I\'m trying to setup the HTTP client so that it uses a proxy, however I cannot quite understand how to do it. The documentation has multiple reference to \"proxy\" but none
Go will use the the proxy defined in the environment variable HTTP_PROXY if it's set. Otherwise it will use no proxy.
HTTP_PROXY
You could do it like this:
os.Setenv("HTTP_PROXY", "http://someip:someport") resp, err := http.Get("http://example.com") if err != nil { panic(err) }