对于http传输使用带git的socks代理 [英] Using a socks proxy with git for the http transport
问题描述
如何让git使用socks代理进行http传输?
我在使用GIT_PROXY_COMMAND配置git时使用socks代理进行GIT传输成功。
另外我配置了我的.curlrc文件来定义socks代理,并且我可以直接使用curl命令获取信息,如:
curl http://git.kernel.org/pub/scm/git/git.git.git/info/refs?service=git-upload-pack
但是,如何使用sit代理和git一起使用http传输协议来检索数据:
git clone http://git.kernel.org/pub/scm/git
我使用Git 1.8.2和SOCKS v5代理进行测试,以下设置适用于我:
<
更新2017-3-31:
根据文档,尽管名称 http
.proxy
,它应该适用于HTTP和HTTPS存储库URL。感谢@user指出这一点。
How to make git use a socks proxy for http transport ?
I successed in configuring git with GIT_PROXY_COMMAND to use a socks proxy for GIT transport.
Also i have configured my .curlrc file to defined the socks proxy and i can fetch informations directly with curl command like:
curl http://git.kernel.org/pub/scm/git/git.git/info/refs?service=git-upload-pack
But how to use a socks proxy with git to retrieve data using the http transport protocol like:
git clone http://git.kernel.org/pub/scm/git
I tested with Git 1.8.2 and SOCKS v5 proxy, following setting works for me:
git config --global http.proxy 'socks5://127.0.0.1:7070'
UPDATE 2017-3-31:
According to the document, despite the name http
.proxy
, it should work for both HTTP and HTTPS repository urls. Thanks @user for pointing out this.
这篇关于对于http传输使用带git的socks代理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!