This is a creation in Article, where the information may have evolved or changed.
Go development in the country is already in the open, but the go developer's pain is that the golang.org website and other related development sites have been GFW blocked. Download go development Package The sea is easier, there are some mirror sites in the country, or can be accessed through some agents, but when downloading some development libraries, these libraries may directly or indirectly refer to the ' golang.org/x/... ' Dependent libraries, go get
there is no way to download them by command.
I was originally in Comcast, this is a foreign company, in the domestic VPN can directly visit these sites, so did not feel that go get
is a problem, see everyone was gfw to get burned when also did not feel is a big thing, now change to domestic internet enterprises, A surly sense of GFW's power. The first is Google.com, golang.org and other sites are blocked, and then go get
some libraries such as golangorg/x/net
failure.
Gotta think of something. If you have their own VPN, should be better than the solution, I do not, but I am more familiar with is shadowsocks, so based on shadowsocks think of some ways, finally can normal download, this paper records this tortuous process.
Shadowsocks installation and use I will not say, please search by yourself. Although shadowsocks can access some shielded sites such as golang.org, it is based on the SOCKS5 protocol, which go get
is still not available.
The next step is to try to convert the SOCKS5 agent to an HTTP proxy.
A method such as Mac host and Docker inside go get proxy settings described in the article Privoxy, but I did not try to succeed.
Another method is the utility cow, which is another development project of the Shadowsocks-go author, according to the project introduction is easy to configure, you can start an HTTP proxy in the native, to Shadowsocks as a two-level agent.
12 |
Listen http://127.0.0.1:7777proxy = socks5://127.0.0.1:1080 |
Then set the environment variable, you can go get
be blocked library.
12 |
export http_proxy=http://127.0.0.1:7777export https_proxy=http:// 127.0.0.1:7777 |
If there is no proxy and you need golang.org/x/...
Package, you can create these directories manually under your Gopath, and then git clone github.com/golang/xxx
the appropriate directory (XXX to replace the required libraries, such as net).