Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

linux - How to config socks5 proxy on Git

I have problem with downloading the git start link (git://anongit.freedesktop.org/wayland/wayland) through a proxy on Linux OS.

I am using Git client (http://git-scm.com/download/linux) to download it, and it is successful to download the http link after I config the http.proxy in the .gitconfig file.

But I have tried a lot of ways to config the socks5 proxy for git link, but it didn't work. Does anyone know this?

More info on this:

  1. I need to use a socks5 proxy with 1080 port.

  2. There are username and password for this socks5 proxy

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The patch mentioned by patthoyts in "Using a socks proxy with git for the http transport" will finally make it upstream in Git 2.7 (Dec. 2015)

See commit 6d7afe0 (26 Oct 2015) by Pat Thoyts (patthoyts).
(Merged by Jeff King -- peff -- in commit 92b9bf4, 01 Dec 2015).

remote-http(s): support SOCKS proxies

With this patch we properly support SOCKS proxies, configured e.g. like this:

git config http.proxy socks5://192.168.67.1:32767

Without this patch, Git mistakenly tries to use SOCKS proxies as if they were HTTP proxies, resulting in a error message like:

fatal: unable to access 'http://.../': Proxy CONNECT aborted

This patch was required to work behind a faulty AP and scraped from Using a socks proxy with git for the http transport and guarded with an appropriate cURL version check by Johannes Schindelin.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...