我有proxyString 123.44.333.42:51244
并希望通过代理请求网址
proxyString := "123.44.333.42:51244"
proxyURL, err := url.Parse("http://"+proxyStr)
if err != nil {
panic(err)
}
////adding the proxy settings to the Transport object
transport := &http.Transport{
Proxy: http.ProxyURL(proxyURL),
}
client := &http.Client{
Transport: transport,
CheckRedirect: func(req *http.Request, via []*http.Request) error {
return http.ErrUseLastResponse
}}
resp, contents := getContent(client, person.personHref)
得到错误Proxy Authentication Required