Skip to content
Simple SOCKS proxy via SSH and iptables
Shell Makefile
Branch: master
Clone or download
Latest commit cbf2153 Mar 22, 2015
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
debian Fix issue after reboot Mar 18, 2015
files Fix issue after reboot Mar 18, 2015
images A bit of explanation and images Feb 1, 2015
.gitignore Initial commit Feb 1, 2015
Makefile Add make target install and uninstall, update readme Feb 9, 2015
README.md Update README.md Mar 22, 2015

README.md

socksproxy

sockproxy is a simple script to run a SOCKS proxy on your own server. It is merely a wrapper script to orchestrate ssh and iptables properly to make it easier in everyday use.

What is socksproxy?

Much like a regular HTTP(S) proxy, a SOCKS proxy can be used to redirect/tunnel traffic through a certain server. This is useful if you want to circumvent country or content-based Internet filtering or access blocked content, e.g., by governments, workplaces, schools, and country-specific web services. Unlike HTTP(S) proxies, however, SOCKS operates on a lower level and can hence also used for other protocols (e.g. FTP, SMTP, ..).

Without socksproxy, the Internet is potentially blocked/filtered by the ISP:

Without socksproxy

With socksproxy (running on a machine without filtered access), all traffic is tunneled to through socksproxy and filters are circumvented:

With socksproxy

Installation

Dependencies are openssh-server and iptables, so be sure to have those installed.

Debian-based systems:

  1. Either download a .deb-file from the release page
  2. Or: Add my Debian/APT archive:
wget -qO - http://archive.philippheckel.com/apt/Release.key | sudo apt-key add -
sudo sh -c "echo deb http://archive.philippheckel.com/apt/release/ release main > /etc/apt/sources.list.d/archive.philippheckel.com.list"
sudo apt-get update
sudo apt-get install socksproxy

Other Linux systems: Manually install it like this:

$ sudo make install
$ sudo make uninstall # To remove

Usage

Edit the config file at /etc/socksproxy.conf and add the allowed IP addresses and (if you like) the port on which the proxy should run on:

# Sets the port on which the proxy can be accessed on.
proxyport=1080

# Defines the IP addresses allowed to use the proxy. 
allowedips=1.2.3.4 5.6.7.8

Then start the SOCKS proxy by running:

$ socksproxy start
Starting socksproxy on port 1080 ... Started with PID 15761.

You can now add it to your browser / operating system config and you are ready to surf via your proxy host!

Build

To build the .deb archive yourself, run the following commands:

$ sudo apt-get install devscripts  # for 'debuild'
$ make clean deb
$ sudo dpkg -i build/*.deb
You can’t perform that action at this time.