Certainly quite a few people suffer from too restrictive networks where you need to use proxy servers to reach outside world. Often applications support using HTTP or FTP proxies. But only few applications do also support SOCKS proxy for arbitrary protocols.
Guess what.. there are tricks to circumvent that 😉
- existing SOCKS proxy reachable on the network
As an example I’ll describe how to connect with git to a remote repository via netcat through a SOCKS proxy. Git command line client itself doesn’t support SOCKS proxies directly. But it does support a proxy command. So we abuse netcat to do the conversion for git.
1.) Step – create a shell script
As git can only handle a proxy command without any parameter we create a small shell script to act as that command:
#!/bin/bash nc -xproxy.mydomain.com:1080 -X5 $*
Save this as proxy_command.sh and give it execution rights.
Now export an environment variable for GIT to make use of this proxy command:
And now you can use git as you would without network restrictions:
git clone git://github.com/altercation/solarized.git