Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
A simple wrapper around socat to use as a git proxy command
# Use socat to proxy git through an HTTP CONNECT firewall.
# Useful if you are trying to clone git:// from inside a company.
# Requires that the proxy allows CONNECT to port 9418.
# Save this file as gitproxy somewhere in your path (e.g., ~/bin) and then run
# chmod +x gitproxy
# git config --global core.gitproxy gitproxy
# More details at
# Configuration. Common proxy ports are 3128, 8123, 8000.
exec socat STDIO PROXY:$_proxy:$1:$2,proxyport=$_proxyport
Copy link

cuongitbk commented Aug 1, 2015

Hi, how can I set authentication information in that case?

Copy link

cuongitbk commented Aug 1, 2015

I found that there is a parameter for authentication:

You can try:

exec socat STDIO PROXY:$_proxy:$1:$2,proxyport=$_proxyport,proxyauth=_user:_passwd

Copy link

ozbillwang commented Nov 4, 2015

where do I save the file gitproxy-socat ?

Found the answser:

Copy link

boly38 commented Dec 22, 2015

another simple workaround (src) :

git config --global url. git://

Copy link

sunjw commented Sep 10, 2016

@boly38 super great workaround for github repos!

Copy link

justdoGIT commented Nov 14, 2017

shouldn't it be "$_user" and "$_passwd" in exec line @cuongitbk

Copy link

Alex-duzhichao commented Apr 26, 2020

another simple workaround (src) :

git config --global url. git://

Nice solution!

Copy link

zhuzhzh commented May 3, 2022

it doesn't work on my machine. I still need to set ~/.ssh/config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment