Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
HAProxy Shadowsocks relay example. You can run this on a server in China with good peering, and then proxy traffic to your outside server. Speed will be better (and improved obfuscation).
# 1. Install haproxy on Ubuntu.
# 2. Edit file path: /etc/haproxy/haproxy.cfg
# 3. Run with: haproxy -f /etc/haproxy/haproxy.cfg
# 4. haproxy will run in the background, so you can disconnect safely.
# 5. Point your Shadowsocks client at <CHINA IP>:8001 (or 8002, etc.) - you will actually be connected to your interational server!
global
ulimit-n 51200
defaults
log global
mode tcp
option dontlognull
timeout connect 1000
timeout client 150000
timeout server 150000
frontend singapore-in
bind *:8001
default_backend singapore-out
backend singapore-out
server server1 123.456.789.0:8888 maxconn 20480
frontend london-in
bind *:8002
default_backend london-out
backend london-out
server server1 123.456.789.0:8888 maxconn 20480
frontend hongkong-in
bind *:8003
default_backend hongkong-out
backend hongkong-out
server server1 123.456.789.0:8888 maxconn 20480
@nabilfreeman
Copy link
Author

nabilfreeman commented Feb 11, 2019

Thanks, me!

@nabilfreeman
Copy link
Author

nabilfreeman commented Oct 30, 2020

Nabs you've done it again, I keep forgetting how to do this and then remember I made this gist 🇨🇳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment