sing-box
$ sing-box 社区开源 高风险sing-box 是高性能 Go 代理引擎,支持入站/出站 HTTP、SOCKS5、Shadowsocks、VMess、VLESS 及 TUN 虚拟网卡。提供 sing-box check 和 sing-box format 用于在启动 sing-box run -c config.json 守护进程前离线校验配置。
brew install sing-box 作为本地操作系统网络代理守护进程和 TUN 数据包路由器(sing-box run)运行;MCP 服务器无法管理本地套接字或 TUN 网卡。
Agent 友好度体检单
当前为静态评估(本机尚未安装或尚未运行探针)。可在本地运行 npm run data:probe 并提交 data/probes/ 升级为实测证据。
FCRS-1.0 六维评分拆解
提供无交互的 check、format 与 version 子命令及清晰退出码,但 run 为长期阻塞守护进程且缺少结构化 CLI 查询输出。
sing-box check -cprovides pre-flight config validationsing-box runoperates as a blocking daemon
离线 check 安全无副作用,但启用 TUN 入站会以管理员权限修改宿主机路由表,且 config.json 中包含明文代理凭据。
- TUN mode requires root/admin and alters system routing
- Proxy credentials reside in plaintext inside
config.json
单一静态 Go 二进制文件,可通过 Homebrew、Linux 包管理器、go install 与 GitHub Releases 安装。
- Available via
brew install sing-boxand cross-platform releases
将多种代理协议、DNS 路由与规则集整合进单一高性能二进制程序中。
- Unified HTTP/SOCKS5/Shadowsocks/TUN routing engine
由 SagerNet 社区积极维护(SagerNet/sing-box),采用 GPL-3.0 协议。
- Active releases in
SagerNet/sing-box
sing-box.sagernet.org 提供结构化的详尽配置文档及内置 --help。
- Official configuration docs at sing-box.sagernet.org
安全边界、鉴权与放权指南
代理服务器地址、用户凭据与 TLS 密钥保存在通过 -c 传入的 JSON 配置文件(如 config.json)中。
免费,基于 GPL-3.0 开源协议的 Go 二进制工具。
# sing-box Agent Rules - Always run `sing-box check -c config.json` before starting or reloading a proxy config. - Never enable `tun` inbound or system-proxy flags unattended—TUN modifies host routing tables and requires elevated privileges. - Avoid printing raw `config.json` secrets into logs.
Agent 高频安全命令配方
只读查询(安全推荐)
sing-box check -c config.json
解析并校验 config.json 中的所有入站、出站与路由规则,成功时返回退出码 0。
sing-box version
显示 sing-box 版本号、Go 运行时及编译特性标签(如 with_gvisor、with_clash_api)。
受控写入与预演
sing-box format -w -c config.json
在验证语法后规范化 config.json 的缩进与字段格式。
核心优势
- +
sing-box check -c可在启动守护进程前离线捕获结构与路由错误。 - + 单一静态二进制即可覆盖 HTTP、SOCKS5、Shadowsocks 与 TUN 网络。
注意事项与踩坑点
- ! TUN 入站需要提权并会改动全局主机路由。
- !
config.json通常以明文保存代理密码或 UUID。