Skip to content

Instantly share code, notes, and snippets.

@cdcs
Last active November 4, 2016 09:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cdcs/bc00ba3121c09013f2c057b549e6930d to your computer and use it in GitHub Desktop.
Save cdcs/bc00ba3121c09013f2c057b549e6930d to your computer and use it in GitHub Desktop.
#!/bin/sh
# 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
# ssh -D 9052 user@external_server
# In a separate terminal run
# chmod +x gitproxy
# git config --global core.gitproxy gitproxy
#
# More details at http://tinyurl.com/8xvpny
# Configuration.
_proxy=127.0.0.1
_proxyport=9052
exec socat STDIO SOCKS4A:$_proxy:$1:$2,socksport=$_proxyport
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment