作者与组织
版权声明为 Copyright (C) 2022 by nekohasekai。联系邮箱在仓库中写为 contact-sagernet@sekai.icu,文档支持页使用 contact@sagernet.org。图形客户端由 Project S 维护。
SagerNet / Project S · 本地知识页
本页汇总 sing-box 官方文档与 GitHub 仓库的公开信息。完整界面与正文已整合到本地文档站,可离线浏览。
没有匹配的章节。可改用更短的关键词,例如「TUN」「客户端」「安装」。
本站为独立静态网站,文档与仓库内容分别放在 wiki/ 与 github/ 栏目下。
官方定位一句话:The universal proxy platform(通用代理平台)。文档站自称是 sing-box 项目的 wiki;仓库 README 只指向文档站,不另写长介绍。
版权声明为 Copyright (C) 2022 by nekohasekai。联系邮箱在仓库中写为 contact-sagernet@sekai.icu,文档支持页使用 contact@sagernet.org。图形客户端由 Project S 维护。
文档站提供 English 与简体中文。中文首页路径为 /zh/,标题为「开始 / 欢迎来到该 sing-box 项目的文档页」。
完整产品说明:安装、图形客户端、手册、JSON 配置、DNS / 路由 / Rule Set、入站出站、服务、实验功能、变更日志、迁移与弃用列表。
源码、Issue、PR、Release 二进制、Docker 镜像构建、文档源文件(docs/ + mkdocs.yml)。README 几乎只重复 slogan、文档链接和许可证。
| 项 | 值(采集时) |
|---|---|
| 仓库 | SagerNet/sing-box |
| 默认分支 | testing(另有 stable / oldstable 发布轨道) |
| 创建时间 | 2022-06-30 |
| Stars / Forks / Watchers | 约 37.2k / 4.5k / 195 |
| Issues / PRs | 约 241 个未关闭 Issue,43 个 PR |
| 提交数 | 约 2,637 |
| 主要语言 | Go(约 96.6%),另有 Shell、Objective-C、Makefile、C、Dockerfile |
| 主贡献者 | nekohasekai(绝大多数提交) |
| 打包状态 | README 嵌入 Repology 徽章 |
CI 脚本按分支区分包名与 Docker tag:stable → sing-box / latest;带连字符的稳定标签视为 beta → sing-box-beta / latest-beta;testing → sing-box-testing;oldstable → sing-box-oldstable。
adapterclientscmd commonconstantdaemon dnsdocsexperimental includelogoption protocolreleaseroute schemaservicetest transport
官方文档把安装分成包管理器仓库、一键脚本、各发行版托管包、Docker、源码编译。文档站根路径 /installation/ 本身 404,实际入口是子页。
# Debian / APT
sudo mkdir -p /etc/apt/keyrings &&
sudo curl -fsSL https://sing-box.app/gpg.key -o /etc/apt/keyrings/sagernet.asc &&
sudo chmod a+r /etc/apt/keyrings/sagernet.asc &&
echo 'Types: deb
URIs: https://deb.sagernet.org/
Suites: *
Components: *
Enabled: yes
Signed-By: /etc/apt/keyrings/sagernet.asc' | sudo tee /etc/apt/sources.list.d/sagernet.sources &&
sudo apt-get update &&
sudo apt-get install sing-box # 或 sing-box-beta
# Red Hat / DNF 5
sudo dnf config-manager addrepo --from-repofile=https://sing-box.app/sing-box.repo
sudo dnf install sing-box
从 GitHub Releases 拉取最新 deb/rpm,也支持 Arch Linux 与 OpenWrt:
curl -fsSL https://sing-box.app/install.sh | sh
curl -fsSL https://sing-box.app/install.sh | sh -s -- --beta
curl -fsSL https://sing-box.app/install.sh | sh -s -- --version <version>
| 平台 | 方式 | 命令 |
|---|---|---|
| Arch Linux | AUR | ? -S sing-box |
| NixOS | nixpkgs | nix-env -iA nixos.sing-box |
| macOS / Linux | Homebrew | brew install sing-box |
| Alpine | APK | apk add sing-box |
| Windows | Scoop / Chocolatey / winget | scoop/choco/winget install sing-box |
| Android Termux | pkg | pkg add sing-box |
| FreeBSD | FreshPorts | pkg install sing-box |
官方点名若干第三方打包改动了默认 build tags,或使用过旧 Go:AOSC、Homebrew、Termux、FreeBSD ports。建议优先用官方仓库或 GitHub Releases。
docker run -d \
-v /etc/sing-box:/etc/sing-box/ \
--name=sing-box \
--restart=always \
ghcr.io/sagernet/sing-box \
-D /var/lib/sing-box \
-C /etc/sing-box/ run
文档写明:sing-box 1.11 需要 Go 1.23.1+;1.10 需要 Go 1.20+。变更日志另写 1.13.0 起至少需要 Go 1.24。简单构建:make 或 make install。自定义:TAGS="tag_a tag_b" make。
默认开启的 build tag 包括 with_quic、with_dhcp、with_wireguard、with_utls、with_acme、with_clash_api、with_gvisor、with_tailscale、with_ccm、with_ocm、with_naive_outbound、with_cloudflared 等。with_grpc、with_v2ray_api、with_embedded_tor 默认关闭。下游打包应直接使用仓库 release/DEFAULT_BUILD_TAGS* 与 release/LDFLAGS。
| 操作 | 命令 |
|---|---|
| 启用 / 禁用 | sudo systemctl enable|disable sing-box |
| 启动 / 停止 / 重启 | sudo systemctl start|stop|restart sing-box |
| 看日志 | sudo journalctl -u sing-box --output cat -e |
| 跟踪新日志 | sudo journalctl -u sing-box --output cat -f |
由 Project S 维护,目标是统一体验并提供平台能力(例如 TUN)。官方明确:大量自称使用 sing-box 的第三方客户端不会列入文档,认为其动机是拉用户,代码质量差且常带广告。
| 平台 | 产品 | 要求 | 获取 |
|---|---|---|---|
| Android | sing-box for Android(SFA) | Android 5.0+ | Play Store / Beta、GitHub Releases、F-Droid(可复现构建、统一签名) |
| iOS / macOS / tvOS | sing-box for Apple platforms(SFI / SFM / SFT) | iOS 15+ / macOS 13+ / tvOS 17+;需要中国大陆以外的 Apple 账号 | App Store、TestFlight(名额给赞助者)、越狱版 SFI-iphoneos-arm64.deb、macOS 可用 brew install sfm |
| Windows / Linux | sing-box for Desktop(Windows 安装包名形如 SFW-*.exe) |
Windows 10+(x64 / x86 / arm64);Linux x64 / arm64 / armv7l | GitHub Releases |
sing-box://import-remote-profile?url=...#name。clash_mode 时提供模式切换;Selector / URLTest 组可切换节点。文档写明:因审核误判,Apple App Store 应用暂时无法更新;TestFlight 用户不受影响。TestFlight 邀请可通过赞助后加入赞助者 Telegram,或向 contact@sagernet.org 发送 Apple ID。
来源:Graphical Clients · Android · Apple · Desktop · General
配置文件是 JSON。1.14 起提供 JSON Schema,可在兼容编辑器里补全和校验。文档发布的 schema 用顶层 $schema 选择;sing-box schema 可按当前二进制和 build tags 生成 schema。
{
"$schema": "https://singbox.ai/wiki/schema.json",
"log": {},
"dns": {},
"ntp": {},
"certificate": {},
"certificate_providers": [],
"http_clients": [],
"network_namespaces": [],
"endpoints": [],
"inbounds": [],
"outbounds": [],
"route": {},
"services": [],
"experimental": {}
}
| 命令 | 作用 |
|---|---|
sing-box check | 检查配置 |
sing-box format -w -c config.json -D config_directory | 格式化并写回 |
sing-box merge output.json -c config.json -D config_directory | 合并多文件配置 |
sing-box api | 1.14 beta 新增:命令行调用 API 服务,能力对齐图形客户端 Dashboard |
directmixedsocks httpshadowsocksvmess trojannaivehysteria shadowtlsvlesstuic hysteria2anytlssnell tunredirecttproxy cloudflared
directbridgeblock sockshttpshadowsocks vmesstrojannaive wireguardhysteriashadowtls vlesstuichysteria2 anytlssnelltor sshdnsselector urltest
block / dns 特殊出站以及 WireGuard outbound 已弃用,分别改用路由动作和 Endpoint。旧字段在 1.13.0 移除。
WireGuardTailscale OpenConnect ClientOpenVPN Client OpenVPN Server
sing-box APIDERPResolved SSM APICCMOCM Hysteria RealmUSB/IP ServerUSB/IP Client
LegacyLocalHosts TCPUDPTLS QUICHTTPSHTTP3 DHCPmDNSFakeIP TailscaleOpenConnectOpenVPN Resolved
客户端手册把图形系统上的代理分成三类:
手册还提供服务端与客户端示例,以及 Shadowsocks、Trojan、Hysteria 2 等协议说明;杂项包括 TunnelVision 与 AnyTLS client metadata。
采集时(2026-08-22)Release 页最新为 1.14.0-beta.17(测试)与 1.13.19(稳定),均标注 Fixes and improvements。
| 版本 | 要点 |
|---|---|
| 1.14.0-beta.15 | 新增 sing-box api;Tailscale 支持 Taildrop(taildrop_directory,默认 Taildrop);Tailscale endpoint 增加 listen_port |
| 1.13.18 | 更新 naiveproxy 到 v150.0.7871.63-1 |
| 1.14.0-beta.7 | Hysteria2 默认模仿 Chrome QUIC 握手;更新 quic-go / Tailscale / gVisor。Ed25519 证书服务器会握手失败,可用 disable_chrome_parrot |
| 1.14.0-beta.5 / 1.13.16 | 默认不再在 AnyTLS 请求中发送客户端元数据,避免被用于画像;可自定义,见 AnyTLS client metadata |
| 1.14.0-beta.2 | JSON Schema;图形客户端编辑器补全 |
| 1.14.0-beta.1 | 修正 rule-set 匹配语义;搜索域规则;并行 DNS 响应评估(race / speculative) |
| 1.14.0-alpha.50 | 提升 OpenVPN / OpenConnect 互操作;Fortinet host check |
| 1.14.0-alpha.48 | AnyConnect SSO;Desktop 客户端提供 Linux 构建 |
| 1.14.0-alpha.47 | OpenVPN Client/Server;OpenConnect Client(AnyConnect、GlobalProtect、Fortinet、F5、Pulse、Juniper) |
| 1.14.0-alpha.44 | 正式推出 Windows 图形客户端 |
| 1.14.0-alpha.43 | Network namespace |
| 版本 | 弃用内容 | 去向 |
|---|---|---|
| 1.14.0 | 远程 rule-set 的 download_detour、隐式默认 HTTP client、TLS 内联 ACME、strategy DNS 动作、若干旧 DNS 字段与 cache store_rdrc | 改用 http_clients、证书提供者等;旧字段计划 1.16.0 删除 |
| 1.12.0 | 旧 DNS server 格式、旧 ECH 字段 | 格式已在 1.14.0 移除;ECH 字段 1.13.0 移除 |
| 1.11.0 | block/dns 特殊出站、部分 inbound 字段、direct 覆盖地址、WireGuard outbound、TUN GSO | 改 rule action / endpoint;1.13.0 移除 |
| 1.10.0 | 拆分的 TUN IPv4/IPv6 地址字段;Go 1.18/1.19 | 合并为 address 等;至少 Go 1.20 |
| 1.8.0 | Clash API 内的 cache_file;GeoIP;Geosite | 独立 cache_file;Rule Set。GeoIP/Geosite 已在 1.12.0 移除 |
| 1.6.0 | ShadowsocksR、Proxy Protocol | 默认从未启用 / 对代理场景无意义 |
来源:Deprecated · Migration
| 渠道 | 链接 |
|---|---|
| GitHub Issues | github.com/SagerNet/sing-box/issues |
| Telegram 通知频道 | t.me/yapnc |
| Telegram 用户群 | t.me/yapug |
| 邮件 | contact@sagernet.org |
来源:Support
GNU GPL v3 或更新版本。附加条款:未经事先同意,衍生作品不得使用该应用名称,也不得暗示与该应用有关联。
Copyright (C) 2022 by nekohasekai <contact-sagernet@sekai.icu>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.