落地机一直用的 ss-rust 搭建 ss2022,使用没问题,最近想加个 vless+ws 协议,本来准备用xray的(别问为啥不用sing-box,就那个配置文件变来变去的还是算了吧),摸鱼看到论坛推荐的新品 shoes,支持的协议挺全的,不像是刚造的新轮子,索性阅读了下他的仓库,rust写的,配置都是yml语法,果断好评!
搭建也简单,以下是详细步骤:
一、直接下载运行 (快速测试)
- 下载对应架构的文件
去 GitHub Releases 页面 下载适合你服务器架构(通常是x86_64-unknown-linux-musl或gnu)的压缩包。
(假设你下载到了/root目录)
# 示例下载命令 (请替换为最新版本的链接)
wget https://github.com/cfal/shoes/releases/download/v0.2.6/shoes-x86_64-unknown-linux-musl.tar.gz
# 解压
tar -xzvf shoes-x86_64-unknown-linux-musl.tar.gz
# 给执行权限
chmod +x shoes
- 准备配置文件
将刚才写好的配置保存为config.yaml,放在和shoes同级目录下,我这里只展示我用得上的两个协议,其中的中文改为自己的配置密钥,/247like是ws的连接路径,其他的详细看作者仓库的示例。
# 证书文件
- pem: pem-cert
path: /shared/ssl/root/247like/388222.xyz/cert.pem
- pem: pem-key
path: /shared/ssl/root/247like/388222.xyz/key.pem
# vless+ws+tls
- address: "[::]:443"
protocol:
type: tls
sni_targets:
"test.388222.xyz":
cert: pem-cert
key: pem-key
protocol:
type: websocket
targets:
- matching_path: "/247like"
protocol:
type: vless
user_id: "你的vless链接ID"
# 可选:默认回落地址(防止探测),可改为自己的
default_target:
dest: "www.beiai.de:443"
# ss2022
- address: "[::]:2525"
protocol:
type: shadowsocks
cipher: 2022-blake3-aes-128-gcm
password: "你的ss2022密钥,需要base64格式"
- 启动测试
因为要监听 443 端口,需要用sudo或 root 身份运行:
sudo ./shoes config.yaml
如果看到类似 "Listening on..." 的日志且没有报错,说明配置成功。自己客户端那边手动构造链接测试没问题后按 Ctrl + C 停止。
二、使用 Systemd 守护进程 (长期稳定推荐)
为了让它在后台运行,并在服务器重启后自动启动,建议创建一个 Systemd 服务。
- 移动文件到标准目录
# 移动二进制文件
sudo mv shoes /usr/local/bin/
# 创建配置目录并移动配置文件
sudo mkdir -p /etc/shoes
sudo mv config.yaml /etc/shoes/config.yaml
- 创建 Service 文件
使用编辑器创建文件:
sudo nano /etc/systemd/system/shoes.service
粘贴以下内容:
[Unit]
Description=Shoes Proxy Service
Documentation=https://github.com/cfal/shoes
After=network.target
[Service]
User=root
# 如果不想用 root 运行,需要给 shoes 文件执行:setcap 'cap_net_bind_service=+ep' /usr/local/bin/shoes
# 然后将 User 改为 nobody 或其他普通用户
# 运行命令
ExecStart=/usr/local/bin/shoes /etc/shoes/config.yaml
# 崩溃自动重启
Restart=on-failure
RestartSec=5s
# 文件描述符限制 (高并发需要)
LimitNOFILE=1048576
[Install]
WantedBy=multi-user.target
- 启动并设为开机自启
# 重载配置
sudo systemctl daemon-reload
# 启动服务
sudo systemctl start shoes
# 设置开机自启
sudo systemctl enable shoes
# 查看运行状态
sudo systemctl status shoes
最终成功运行状态:
root@LegendVPS-sg1:~# sudo systemctl status shoes
● shoes.service - Shoes Proxy Service
Loaded: loaded (/etc/systemd/system/shoes.service; enabled; preset: enabled)
Active: active (running) since Tue 2026-01-20 17:28:29 CST; 21min ago
Docs: https://github.com/cfal/shoes
Main PID: 18029 (shoes)
Tasks: 4 (limit: 537)
Memory: 6.1M
CPU: 8.665s
CGroup: /system.slice/shoes.service
└─18029 /usr/local/bin/shoes /etc/shoes/config.yaml
rust写的占用确实低,比探针都要占用内存小些:
top - 17:52:03 up 12 days, 7:28, 2 users, load average: 0.02, 0.02, 0.00
Tasks: 78 total, 1 running, 77 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.3 us, 1.3 sy, 0.0 ni, 98.3 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
MiB Mem : 470.0 total, 218.2 free, 278.7 used, 168.5 buff/cache
MiB Swap: 0.0 total, 0.0 free, 0.0 used. 191.3 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
45051 root 20 0 1244380 17024 9712 S 0.0 3.5 13:24.97 nezha-agent
18029 root 20 0 52836 12864 8488 S 0.3 2.7 0:09.06 shoes
19817 root 20 0 17428 10948 9380 S 0.0 2.3 0:00.03 sshd
60241 _247like 20 0 18876 10188 8696 S 0.0 2.1 0:00.05 systemd
1 root 20 0 102564 9076 5768 S 0.0 1.9 8:55.41 systemd
214 root 20 0 65888 7160 5864 S 0.0 1.5 6:22.95 systemd-journal
19825 _247like 20 0 17820 6644 4612 S 0.7 1.4 0:00.32 sshd