git:// through proxy

后端 未结 4 2123
醉话见心
醉话见心 2020-12-12 11:46

I\'m behind a firewall that is blocking port 9418 (git) and am trying to install some tools that are explicitly doing a checkout of git://github.com/..., so I c

4条回答
  •  甜味超标
    2020-12-12 12:07

    Have you tried an ssh-based TCP tunnel? If you have an ssh server that (a) is outside your firewall and (b) allows IP forwarding, you can do:

    ssh -L localhost:9418::9418 me@remote-ssh-server
    

    or, if you have to run sshd on port 443 to get around your firewall,

    ssh -P 443 -L localhost:9418::9418 me@remote-ssh-server
    

    Then, locally:

    git checkout git://localhost/...
    

    Obviously this isn't transparent, and it's a little convoluted - there are no doubt tools out there that are more specifically targetted at the problem. However, I typically use this method because it uses tools I have to hand (ssh and a cheapo virtual server I rent).

    (I've actually never tried this with a git connection, but I see no reason why it wouldn't work. I've used it with many other single-TCP-port protocols without problem.)

提交回复
热议问题