git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Using socks proxy with git for http(s) transport

From
YBYves Blusseau <yves.blusseau@gmail.com>
Date
Mar 6, 2013, 10:09 UTC
Message-ID
<CABmRxH25y9bAdZWV_3MG7x2LNGNDQbLB_EJC1xAJC396nO7bYQ@mail.gmail.com>
In-Reply-To
<20130306094552.GA11531@sigill.intra.peff.net>
2013/3/6 Jeff King <peff@peff.net>:
Show 18 quoted lines
> On Wed, Mar 06, 2013 at 10:21:42AM +0100, Yves Blusseau wrote:
>
>> > Try:
>> >
>> >   git config --global http.proxy 'socks://yourhost:port'
>> >
>> > That will enable it for all git repositories on your machine. Git should
>> > also respect any environment variables that curl handles (because we use
>> > libcurl under the hood), if you prefer to set it up that way. See "man
>> > curl" for details.
>>
>> Thanks Jeff but it's not working.
>
> Hmm. I just double-checked, and it works for me.
>
>> I use git 1.8.15
>
> I assume you mean 1.8.1.5 here.
Yes it's 1.8.15 sorry for the mistake
Show 18 quoted lines
>
>> My socks proxy listen on my localhost at port 1080 so I do:
>> git config --global http.proxy  'socks://127.0.0.1:1080'
>
> That looks right to me.
>
>> But when i try to talk with a git server with http protocol i have:
>> [...]
>> * About to connect() to proxy 127.0.0.1 port 1080
>> *   Trying 127.0.0.1... * connected
>> * Connected to 127.0.0.1 (127.0.0.1) port 1080
>> > GET http://git.kernel.org/pub/scm/git/git.git/info/refs?service=git-upload-pack HTTP/1.1
>> [...]
>> * Empty reply from server
>
> If I set up a simple socks proxy with ssh, like:
>
>   ssh -v -D 1080 my-ssh-host
My socks proxy is also a socks proxy with ssh
Show 10 quoted lines
>
> and run the same command, I get:
>
>   * About to connect() to proxy localhost port 1080 (#0)
>   *   Trying 127.0.0.1...
>   * SOCKS4 request granted.
>   * Connected to localhost (127.0.0.1) port 1080 (#0)
>   > GET /pub/scm/git/git.git/info/refs?service=git-upload-pack HTTP/1.1
>   [...]
>   < HTTP/1.1 200 OK

You have a (#0) in the log that i have when using curl directly with the socks proxy

Show 6 quoted lines
>
> and it works. It does look like curl is treating localhost:1080 as a
> regular http proxy. What version of libcurl do you have? Is there
> anything in your environment that might be causing it to override the
> configured proxy setting (e.g., an http_proxy or https_proxy environment
> variable)?

I have try with an old version of curl: 7.15.5 and with the latest in development curl 7.29.1-DEV. But it seem that git-remote-http is compile with the old one.

I have no http/proxy environment variables
Previous: Jeff KingNext: Daniel Stenberg
Message 5 of 8 in “Using socks proxy with git for http(s) transport”
  1. Yves BlusseauMar 6, 2013
  2. Jeff KingMar 6, 2013
  3. Yves BlusseauMar 6, 2013
  4. Jeff KingMar 6, 2013
  5. Yves BlusseauMar 6, 2013
  6. Daniel StenbergMar 6, 2013
  7. Yves BlusseauMar 6, 2013
  8. ciorapalb100Jun 15, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.