CDN代理 CDN代理相比传统代理的优点
Server v2ray-plugin
下载1 2 3 4 5 6 7 8 mkdir v2ray-plugin && cd v2ray-pluginwget https://github.com/shadowsocks/v2ray-plugin/releases/download/v1.3.2/v2ray-plugin-linux-amd64-v1.3.2.tar.gz tar -xzvf v2ray-plugin-linux-amd64-v1.3.2.tar.gz cp v2ray-plugin_linux_amd64 /usr/local/bin/v2ray-plugin
Shadowsocks-libev
下载1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 mkdir shadowsocks && cd shadowsockswget https://github.com/shadowsocks/shadowsocks-rust/releases/download/v1.23.4/shadowsocks-v1.23.4.x86_64-unknown-linux-gnu.tar.xz tar -xvf shadowsocks-v1.23.4.x86_64-unknown-linux-gnu.tar.xz cp ssserver /usr/local/bin- 配置 `/etc/shadowsocks-rust/config.json` ```json { "server" :"0.0.0.0" , "server_port" :<port>, "password" :"<key>" , "timeout" :300, "user" :"nobody" , "method" :"aes-256-gcm" , "fast_open" :true , "nameserver" :"8.8.8.8" , "mode" :"tcp_and_udp" , "workers" : 8, "plugin" : "v2ray-plugin" , "plugin_opts" : "server;path=/ws" }
1 2 3 4 5 - 设置systemd service ```bash vim /etc/systemd/system/shadowsocks-rust.service
1 2 3 4 5 6 7 8 9 10 11 [Unit] Description=Shadowsocks rust server Service After=network.target [Service] Type=simple ExecStart=/usr/local/bin/ssserver -c /etc/shadowsocks-rust/config.json Restart=on-abort [Install] WantedBy=multi-user.target
1 2 systemctl enable shadowsocks-rust.service systemctl start shadowsocks-rust.service
Nginx 编辑/etc/nginx/nginx.conf
, 在目标host下,将/ws
路由分流到shadowsocks-rust服务,因为nginx已经处理过tls了,所以shadowsocks-rust服务不是用tls配置, 反之,如果你的ss-rust直接监听443, 则/etc/shadowsocks-rust/config.json
中需要tls;cert=...;key=
等
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 server { listen 80; listen [::]:80; listen 443 ssl http2; listen [::]:443 ssl http2; server_name _; root /usr/share/nginx/html; location /ws { proxy_redirect off; proxy_http_version 1.1; proxy_pass http://localhost:29595; # Port of v2ray-plugin proxy_set_header Host $http_host; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } }
Client 这里不做过多赘述,直接使用archlinux pacman源
Install 1 sudo pacman -S shadowsocks-rust shadowsocks-v2ray-plugin
Config /etc/shadowsocks-rust/config.json
1 2 3 4 5 6 7 8 9 10 11 12 { "server" : "<domain>" , "server_port" : <port>, "local_address" : "127.0.0.1" , "local_port" : 1080 , "password" : "<key>" , "timeout" : 300 , "method" : "aes-256-gcm" , "fast_open" : true , "plugin" : "v2ray-plugin" , "plugin_opts" : "tls;host=<domain>;path=/ws" }
Run 1 2 systemctl enable shadowsocks-rust@config systemctl start shadowsocks-rust@config