ShadowSocks Setup Guide

Wiki

ShadowSocks is a secure socks5 proxy, designed to protect your Internet traffic. GoAgentX is a GUI application on OS X for using and controlling proxy services.

Official Website shadowsocks.org

Linux / Server Side Install

You'll have a client on your local machine, and install a server on a remote server.

Debian / Ubuntu

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

CentOS

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

Configuration On your server create a config file /etc/shadowsocks.json. Example:

{
    "server"       : "my_server_ip",
    "server_port"  : 8388,
    "local_address": "127.0.0.1",
    "local_port"   : 1080,
    "password"     : "mypassword",
    "timeout"      : 300,
    "method"       : "aes-256-cfb",
    "fast_open"    : false,
    "workers"      : 1
}

Explanation of the fields

Name Explanation
server the address your server listens
server_port server port
local_address the address your local listens
local_port local port
password password used for encryption
timeout in seconds
method encryption method, "rc4-md5" is recommended
fast_open use TCP_FASTOPEN, true / false
workers number of workers, available on Unix/Linux

To run in the background:

$ sudo ssserver -p 8388 -k password -m rc4-md5 --user nobody -d start

To stop:

$ sudo ssserver -d stop

To check the log:

$ sudo less /var/log/shadowsocks.log

Optimeze TCP Connection

Increase TCP link limit add following configuration to /etc/security/limits.conf file:

* soft nofile 51200
* hard nofile 51200

Add following configuration to /etc/sysctl.conf file:

# max open files
fs.file-max = 51200
# max read buffer
net.core.rmem_max = 67108864
# max write buffer
net.core.wmem_max = 67108864
# max processor input queue
net.core.netdev_max_backlog = 250000
# max backlog
net.core.somaxconn = 4096
# resist SYN flood attacks
net.ipv4.tcp_syncookies = 1
# reuse timewait sockets when safe
net.ipv4.tcp_tw_reuse = 0
# turn off fast time wait sockets recycling
net.ipv4.tcp_tw_recycle = 0
# short FIN timeout
net.ipv4.tcp_fin_timeout = 30
# short keepalive time
net.ipv4.tcp_keepalive_time = 1200
# outbound port range
net.ipv4.ip_local_port_range = 10000 65000
# max SYN backlog
net.ipv4.tcp_max_syn_backlog = 8192
# max timewait sockets held by system simultaneously
net.ipv4.tcp_max_tw_buckets = 5000
# 
net.ipv4.tcp_fastopen = 3
# 
net.ipv4.tcp_mem = 25600 51200 102400
# TCP receive buffer
net.ipv4.tcp_rmem = 4096 87380 67108864
# TCP write buffer
net.ipv4.tcp_wmem = 4096 65536 67108864
# turn on path MTU discovery
net.ipv4.tcp_mtu_probing = 1
#
net.ipv4.tcp_congestion_control = hybla

Reload configuration and set ShadowSocks lanuch params fast_open: true:

$ sudo sysctl -p

OS X GUI Clients

Download and install GoAgentX V2.7.3 build 774 from Google Drive. Setup services, fill in Local Port, Server Address, Server Port, Timeout(Seconds), Service Password and select Encrypt Method.

ShadowSocks Setup Guide

Global Proxy

System Preferences → Select your network → Advanced → Proxies → SOCKES Proxy → Fill in SOCKES Proxy Server and Port → Save → Apply.

ShadowSocks Setup Guide

Other clients reference

github.com/shadowsocks/shadowsocks/wiki/Ports-and-Clients

Google Chrome Extension

Install ExtensionProxy SwitchyOmega Plugin on Google Chrome in Proxy Profiles tab, New Profile → Profile Details → Profile Name: Shadowsocks → SOCKS Host → Save.

ShadowSocks Setup Guide

Reference

ShadowSocks - A fast tunnel proxy that help you get through firewalls

ShadowSocks Setup Guide
5 votes, 4.20 avg. rating (85% score)