How to set an SOCKS proxy for `go get` in docker container

1,492 views
Skip to first unread message

Xiaohui Liu

unread,
Sep 1, 2015, 9:01:47 AM9/1/15
to golang-nuts
Hi guys, 

I am running an docker container to build docker/machine(https://github.com/docker/machine/blob/master/Dockerfile) behind the GFW(https://en.wikipedia.org/wiki/Great_Firewall). Unfortunately, https://golang.org is blocked by GFW, so I couldn't build the docker/machine. 
Now, I just have an SOCKS5 Proxy, any ideas about how to setting SOCKS proxy in an docker container to make `go get` work?




thanks.

she...@gmail.com

unread,
Nov 11, 2015, 10:25:10 AM11/11/15
to golang-nuts
You may check the privoxy, and links http://stackoverflow.com/questions/10383299/how-do-i-configure-go-to-use-a-proxyhttp://blog.shenwei.me/a-collection-of-go-packages/

在 2015年9月1日星期二 UTC+8下午9:01:47,Xiaohui Liu写道:

Darren Hoo

unread,
Nov 12, 2015, 5:51:43 AM11/12/15
to golang-nuts
I would recommend you to use cow [https://github.com/cyfdecyf/cow.git]

If you've already been using shadowsocks, cow directly supports SS. It also support socks5 as upstream proxy.

After you setup cow, all you have to do is setting http_proxy and https_proxy enviroment variable, `go get` honors that and works like a charm. 

vahid....@gmail.com

unread,
Apr 2, 2016, 7:21:58 AM4/2/16
to golang-nuts
Unfortunately its Chinese. too bad idea to authoingr the readme  in chinese.
Reply all
Reply to author
Forward
0 new messages