Remux

自建 remux-relay(免费)

在你自己的 VPS 上运行与官方相同的中继二进制。 非官方 host 不计费。画面端到端加密,中继只转发密文。

准备

1. 下载二进制

Linux x86_64(glibc ≤ 2.35,可在 Ubuntu 22.04+ 运行):

curl -fsSL -o remux-relay https://remux.eds-on.life/downloads/remux-relay-linux-x86_64
curl -fsSL -o remux-relay.sha256 https://remux.eds-on.life/downloads/remux-relay-linux-x86_64.sha256
sha256sum -c remux-relay.sha256
sudo install -m 0755 remux-relay /opt/remux-relay
sudo useradd --system --no-create-home remux || true

2. systemd

进程只监听本机回环;前面用 nginx 或 Caddy 做 TLS。健康检查默认在 127.0.0.1:9878,不要对公网开放。

[Unit]
Description=Remux self-hosted relay
After=network.target

[Service]
Type=simple
ExecStart=/opt/remux-relay 127.0.0.1:9877
Restart=on-failure
RestartSec=3
User=remux
NoNewPrivileges=true

[Install]
WantedBy=multi-user.target
sudo systemctl enable --now remux-relay
curl -sS http://127.0.0.1:9878/health

3. TLS 反代

Caddy

relay.example.com {
  reverse_proxy 127.0.0.1:9877
}

nginx

/(可选 /ws)上做 WebSocket 升级到 http://127.0.0.1:9877,证书用 Let’s Encrypt,proxy_*_timeout ≥ 300s。完整参考见仓库 docs/deployment/relay-nginx.conf 与伪装页 docs/deployment/relay-public/。不要暴露 metrics 端口 9878。

# 防火墙
sudo ufw allow OpenSSH
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw --force enable

4. Agent 指向你的中继

  1. 桌面 Agent 配置 relay_url = "wss://relay.example.com"(或环境变量 REMUX_RELAY_URL)。自建不需要官方 NAT 订阅。
  2. 重启 Agent。托盘二维码变为带你域名的中继码。
  3. 手机扫该码。连接卡片应显示你的 host(自建路径),而不是官方 Remux_NAT 品牌样式。

5. 验证

VPS 与域名由你运维,请自行更新二进制。官方 remuxnat*.eds-on.life 仍是独立的试用/付费产品。更长运维说明见仓库 docs/deployment/self-host-remux-relay.md