Code Locket Menu

How to Setup SOCKS Proxy

Blog post created on 2016-02-07

CentOSMiscellaneous

There are a lot of reasons you might need a proxy and with VPS providers readily available it is possible to get going in less than a few minutes. Additionally, VPS providers often charge by the hour reducing your cost considerably and allowing you to switch off/on your proxy as needed. For the purposes of this tutorial let us assume you are outside of the UK and you need a proxy within the UK:

The droplet will require you to change your default password but that is expected. Once you are logged in with root setting up a SOCKS proxy is tremendously easy. So easy, in fact, that it can be achieved with one simple command:

ssh -f -N -D 0.0.0.0:28128 localhost

Once you have run the command you can change your browser settings, for example, to use the proxy.

The settings are found in different places depending on your OS. On Windows you need to head over to Internet Options -> Connections -> LAN Settings -> tick the Proxy Server box -> Advanced and finally set the dialog as in the image below replacing the x characters with the IP address of your VPS.

SOCKS proxy

The ssh command has a SOCKS server built in. Let us analyze the command in detail:

And there you have it, your 5 minute SOCKS proxy. When you are done you can simply destroy the droplet from the DigitalOcean interface.