Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to config socks5 proxy on Git

Tags:

git

linux

proxy

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

like image 896
E Ake Avatar asked Mar 16 '23 22:03

E Ake


1 Answers

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.

like image 149
VonC Avatar answered Mar 20 '23 07:03

VonC