go错误拨号tcp:协议不可用
当我尝试为rest api clint运行GO代码时,我遇到了错误: Get:http:连接到代理时出错:拨号tcp 192.168.0.1:3128:i/o超时 此外,我还在围棋场上尝试了同样的代码。也出现了错误 原因可能是什么?我怎样才能解决这个问题?请帮我解决这个问题 我使用的代码是:-go错误拨号tcp:协议不可用,go,tcp,http-proxy,Go,Tcp,Http Proxy,当我尝试为rest api clint运行GO代码时,我遇到了错误: Get:http:连接到代理时出错:拨号tcp 192.168.0.1:3128:i/o超时 此外,我还在围棋场上尝试了同样的代码。也出现了错误 原因可能是什么?我怎样才能解决这个问题?请帮我解决这个问题 我使用的代码是:- package main import( "net/http" "fmt" "io/ioutil" ) func main() { resp, er := http.
package main
import(
"net/http"
"fmt"
"io/ioutil"
)
func main() {
resp, er := http.Get("http://quotes.rest/qod.json")
if er!=nil{
fmt.Println(er)
return
}
defer resp.Body.Close()
content, err := ioutil.ReadAll(resp.Body)
if err!=nil{
fmt.Println(err)
return
}
fmt.Println(string(content))
}
围棋场不允许HTTP请求。这与代码无关。这是游乐场强制执行的安全预防措施。围棋场不允许HTTP请求。这与代码无关。这是游乐场强制执行的安全预防措施。您的客户端无法连接到代理,您的代理是否工作?代理也不工作您的客户端无法连接到代理,您的代理是否工作?代理也不工作