Shadowsocks is an open source, secure, fast and lightweight socks5 proxy, bypassing geolocation restrictions and restrictive firewalls. Software is available for different platforms. We will be using EC2 Amazon Web Services for the installation of Shadowsocks. Use this tutorial for the EC2 Server setup.

Setting Up Shadowsocks on your EC2 Server (check out this tutorial for the EC2 Setup)

CentOS/RHEL (used in our EC2 Setup)

sudo yum install m2crypto python-setuptools sudo easy_install pip sudo pip install shadowsocks

Debian/Ubuntu

sudo apt-get install python-pip python-m2crypto sudo pip install shadowsocks

Create a configuration file and add following

sudo vi /etc/shadowsocks.json

{ "server":"your_server_ip", "server_port":8000, "local_port":1080, "password":"your_passwd", "timeout":600, "method":"aes-256-cfb" }

Example:

{ "server":" 0.0.0.0 ", "server_port": 8080 , "local_port":1080, "password":" 1234 ", "timeout":600, "method":"aes-256-cfb" }

Save and close the file with :qw, then start shadowsocks server

sudo ssserver -c /etc/shadowsocks.json -d start

I had to start the server as per below. Path was not set:

cd /usr/local/bin sudo ./ssserver -c /etc/shadowsocks.json -d start

Should ssserver not be in the path, you can add it as follow:

Echo $PATH export PATH=$PATH:~/usr/local/bin/ssserver

To start the client automatically after a systems boot, use as follow:

Edit /etc/rc.local :

sudo vi /etc/rc.local

and add following:

/usr/bin/python /usr/local/bin/ssserver -c /etc/shadowsocks.json -d start

Save and close. Next time you restart the server or instance, shadowsocks will automatically start

Check and test whether it’s working

After a reboot check whether the process is working

ps -aux

You should see following

root 3163 0.0 1.2 210644 13032 ? Ss Jul11 0:06 /usr/bin/python2.7 ./ssserver -c /etc/shadowsocks.json -d start

Start and stop shadowsocks

stop shadowsocks server:

sudo ssserver -d stop

restart shadowsocks server:

sudo ssserver -c /etc/shadowsocks.json -d restart

check the log file:

less /var/log/shadowsocks.log

Firewall settings

You may have to allow traffic through your iptables firewall:

sudo iptables -I INPUT -p tcp --dport 8080 -j ACCEPT

Add rules to allow internet traffic:

sudo modprobe iptable_nat echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward sudo iptables -t nat -A POSTROUTING -s 10.1.0.1/2 -o eth0 -j MASQUERADE

Add inbound rules to your Security Group on your EC2 Dashboard:

iOS Shadowsocks Client

Download the IOS App ShadowProxy from the Apple Store

Use the IP address of your EC2 instance for your Server IP address. If everything went well and you followed all the steps, you should be connected. Check the IP address at http://whatismyip.com

Windows Client

Download Shadowsocks-4.0.4.zip

https://github.com/shadowsocks/shadowsocks-windows/releases

Add following settings, circled in red. Get the Server Address from the EC2 console.

In Chrome use SwitchySharp and set your settings as follow:



For more clients, go to https://shadowsocks.org/en/download/clients.html

Conclusion

ShadowSocks works great and faster than VPN. Of course this will depend on your ISP and Server load. Rember, ShadowSocks is to circumvent blocked traffic and not to make you anonymous.