Shadowsocks-Rust 简介

shadowsocks-rust 是 Shadowsocks 的 Rust 语言实现,它不仅具有传统 Shadowsocks 特性,而且还具有:

  • 负载均衡 多个 Shadowsocks 服务器的能力。
  • 探测 Shadowsocks 服务器延迟的能力。

相比于 shadowsocks-libev , 优点在于提供构建好的二进制文件,大大降低了安装成本。

安装

Release 下载静态链接构建包

1
2
3
wget https://github.com/shadowsocks/shadowsocks-rust/releases/download/v1.11.2/shadowsocks-v1.11.2.x86_64-unknown-linux-gnu.tar.xz

tar -xvf shadowsocks-v1.11.2.x86_64-unknown-linux-gnu.tar.xz -C /usr/local/bin

配置

配置文件参考 Configuration

以 root 用户创建 /etc/systemd/system/shadowsocks-rust-server.service

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
#  This file is part of shadowsocks-rust.
#
#  This is a template unit file. Users may copy and rename the file into
#  config directories to make new service instances. See systemd.unit(5)
#  for details.

[Unit]
Description=Shadowsocks-rust Custom Server Service for %I
Documentation=https://github.com/shadowsocks/shadowsocks-rust
After=network.target

[Service]
Type=simple
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
ExecStart=/usr/local/bin/ssserver --log-without-time -c /etc/shadowsocks-rust/config.json

[Install]
WantedBy=multi-user.target

注册并启动服务:

1
2
3
systemctl daemon-reload
systemctl enable shadowsocks-rust-server.service
systemctl start shadowsocks-rust-server.service