下午安装一个golang库的时候提示:

➜  / go get -u github.com/huin/goupnp
package golang.org/x/net/html/charset: golang.org/x/net is a custom import path for https://go.googlesource.com/net, but /Users/dingdayu/go/src/golang.org/x/net is checked out from https://github.com/golang/net.git
net
src/golang.org/x/nethttps://go.googlesource.com/net
➜  x git clone https://go.googlesource.com/net
Cloning into 'net'...
fatal: unable to access 'https://go.googlesource.com/net/': Failed to connect to go.googlesource.com port 443: Operation timed out
go.googlesource.com

两个方法设置代理

配置临时代理

export http_proxy=localhost:1080

代理地址:localhost:1080

仅本次控制台有效

配置git全局代理

git config --global http.proxy "localhost:1080"

代理地址:localhost:1080

如果代理地址正确,就可以拉取了。

➜  x git clone https://go.googlesource.com/net
Cloning into 'net'...
remote: Total 7005 (delta 3452), reused 7005 (delta 3452)
Receiving objects: 100% (7005/7005), 9.79 MiB | 105.00 KiB/s, done.
Resolving deltas: 100% (3452/3452), done.