How to get some libraries behind the Great Wall go

Source: Internet
Author: User
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).

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.