go get 怎么设置代理?

package github.com/hoisie/web imports code.google.com/p/go.net/websocket: Get https://code.google.com/p/go/source/checkout?repo=net: dial tcp 173.194.127.166:443: ConnectEx tcp: A connection attempt failed beca use the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

http://stackoverflow.com/questions/10383299/how-do-i-configure-go-to-use-a-proxy 搜索到的解决办法是 设置 http_proxy=127.0.0.1:8080 go get github.com/hoisie/web 但是win32下这样貌似不行

共 6 个回复


bitcoin

os.Setenv("HTTP_PROXY", "http://127.0.0.1:8080") 这样不行吗?

# 0

bitcoin

或者自定义一个http.Client,在Transport里面的Proxy设置。

# 1

David

go get 会最后调用 git/hg ,根据代码所在网站支持的服务决定。所以,看看怎么设置 git/hg 的 proxy 就好了。

# 2

tablecell

win32下要分开写 set http_proxy=127.0.0.1:8080 go get github.com/hoisie/we

# 3

tablecell

这个论坛怎么输入回车换行?

# 4

jimmykuu

多空一行就换行了

# 5