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

Re: Fwd: [OT] Re: Git via a proxy server?

From
PVPetr Vandrovec <petr@vmware.com>
Date
May 16, 2006, 13:11 UTC
Message-ID
<4469CF92.2010002@vmware.com>
In-Reply-To
<20060516121356.11646.qmail@web32002.mail.mud.yahoo.com>
Sam Song wrote:
Show 52 quoted lines
> Hello,
> 
> Petr Vandrovec <petr@vmware.com> wrote:
> 
>>Date:	Mon, 27 Feb 2006 00:35:00 +0100
>>From:	Petr Vandrovec <petr@vmware.com>
>>To:	Sergey Vlasov <vsu@altlinux.ru>
>>CC:	"Salyzyn, Mark" <mark_salyzyn@adaptec.com>,
>>	Kernel Mailing List 
>><linux-kernel@vger.kernel.org>
>>
>>>[snip]
>>>I have successfully used transconnect
>>>(http://sourceforge.net/projects/transconnect) for
>>>tunnelling git
>>>protocol through a HTTP proxy (squid in my case)
>>>supporting the CONNECT method.
>>>
>>>[snip] 
>>>Note: most HTTP proxy servers allow CONNECT method
>>>to a very limited range of ports, and 
>>>administrators will need to enable the git port
>>>(9418) explicitly.
>>>
>>
>>I know I'm coming kinda late, but I'm using:
>>
>>export GIT_PROXY_COMMAND=/usr/local/bin/proxy-cmd.sh
>>
>>and proxy-cmd.sh is just single-line command glued
>>from what I found available in /bin:
>>
>>#! /bin/bash
>>
>>(echo "CONNECT $1:$2 HTTP/1.0"; echo; cat ) | socket
>>
>>proxy.ourcompany.com 3128 | (read a; read a; cat )
>>
>>Replace socket's arguments 'proxy.ourcompany.com
>>3128' with your http proxy.  Fortunately our proxy
>>does not see anything wrong with git's port.
>>		Best regards,
>>			Petr Vandrovec
> 
> 
> With above usage on GIT_PROXY_COMMAND, I still have
> problem on connection with remote git repository.
> 
> I also tried setting http_proxy directly but the same
> result. It's first usage of git in our network. Well, 
> need I enable the git port 9418 at proxy server? Or 
> did I miss sth or what?
Yes.  Try running 'socket 192.168.40.99 80', and type
CONNECT 204.152.191.37:9418 HTTP/1.0
Proxy-Authorization: Basic <yoursecret,f.e.wget -d should reveal this to you>
<empty line>

You should get back user readable diagnostics what went wrong. Yes, your admin must allow CONNECT method for target port 9418.

Show 10 quoted lines
> I use git-2006-05-14.tar.gz package on FC3. 
> 
> Method I : Use GIT_PROXY_COMMAND
> 
> [root@sam u-boot]# git clone \
> git://www.denx.de/git/u-boot.git u-boot-denx.git
> 
> fatal: exec failed
> fetch-pack from 'git://www.denx.de/git/u-boot.git' 
> failed.

Is $GIT_PROXY_COMMAND executable? (just in case...) Try 'strace -f git clone ...', it should tell you what's going on.

> #! /bin/bash
> 
> (echo "CONNECT $1:$2 HTTP/1.0";echo;cat) | socket
> <um> <pwd> 192.168.40.99 80 | (read a;read a;cat)

What is '<um>' and '<pwd>' ? socket just connects somewhere, so if you are supposed to use <username>:<pwd> to connect to your proxy, you must add Proxy-Authorization header yourself:

(echo "CONNECT $1:$2 HTTP/1.0";
  echo "Proxy-Authorization: Basic <base64encoded um:pwd>";
  echo;
  cat ) | socket 192.168.40.99 80 | (read a; read a; cat)

Best to test this is to start 'socket 192.168.40.99 80' from command line and then type these two lines above, plus one empty line. You should get back '200 OK', empty line, and then you can start communicating using git protocol - if you can do that...

Show 6 quoted lines
> Method II : Use http_proxy directly
> 
> [root@sam u-boot]# export \
> http_proxy="http://<username>:<pwd>@192.168.40.99:80"
> [root@sam u-boot]# git clone \ 
> http://parisc-linux.org/git/linux-2.6.git/ parisc-2.6
As far as I can tell, http_proxy is ignored (Debian's git 1.3.2-1/cogito 0.17.2-1).
								Petr
Previous: Sam SongNext: Sam Song
Message 2 of 7 in “Fwd: [OT] Re: Git via a proxy server?”
  1. Sam SongMay 16, 2006
  2. Petr VandrovecMay 16, 2006
  3. Sam SongMay 17, 2006
  4. Jan-Benedict GlawMay 17, 2006
  5. Petr VandrovecMay 17, 2006
  6. Sam SongMay 18, 2006
  7. Jan-Benedict GlawMay 18, 2006

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.