Last active
April 3, 2023 00:00
-
-
Save nabilfreeman/6cf00c0cb909c353f478e40d1438b449 to your computer and use it in GitHub Desktop.
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
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 |
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
Thanks, me!