Updated Setup a Shadowsocks relay (markdown)

clowwindy 2015-01-11 21:21:55 +08:00
parent 345edcbc85
commit 1c8aafe2f2

@ -5,13 +5,19 @@ If you want your client connected to a Japan VPS, but you want a US IP.
### Easy version: ### Easy version:
1. Setup Shadowsocks server as usual on US VPS. 1. Setup Shadowsocks server as usual on US VPS.
2. Install socat on Japan VPS. 2. On Japan VPS, enable forwarding. Replace `US_VPS_IP` and `JP_VPS_IP` with actual IP:
3. Run `socat TCP-LISTEN:8388,fork TCP:US_VPS_IP:8388` on Japan VPS.
4. Set your server to JAPAN_VPS_IP:8388 on your client. sudo su
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A PREROUTING -p tcp --dport 8388 -j DNAT --to-destination US_VPS_IP:8388
iptables -t nat -A POSTROUTING -p tcp -d US_VPS_IP --dport 8388 -j SNAT --to-source JP_VPS_IP
3. Set your server to JAPAN_VPS_IP:8388 on your client.
### Better version: ### Better version:
For those who need high performance, use haproxy instead of socat. For those who want more control and better performance, use haproxy instead.
You can also enable load balance by adding multiple servers.
For Debian 7.0: For Debian 7.0:
@ -21,7 +27,6 @@ On Japan VPS. Append the following line to `/etc/apt/sources.list`
Run Run
apt-get udpate
apt-get install haproxy apt-get install haproxy
Edit `/etc/haproxy/haproxy.cfg` Edit `/etc/haproxy/haproxy.cfg`