Sing-box 简介
Sing-box 是一个新一代的代理平台,由 SagerNet 团队开发,旨在提供统一、高效的代理解决方案。相比传统的 Clash、V2Ray 等工具,Sing-box 采用了更现代化的架构设计,支持多种协议(VMess、VLESS、Trojan、Shadowsocks、Hysteria 2、TUIC 等),并且原生支持出站规则、DNS 路由、TUN 模式等高级功能。
核心特性
- 多协议支持:VMess、VLESS、Trojan、Shadowsocks、Hysteria 2、TUIC、WireGuard
- 出站规则:基于域名、IP、GEOIP 的智能分流
- DNS 路由:支持 DNS over HTTPS、DNS over TLS
- TUN 模式:系统级透明代理,无需配置系统代理
- 跨平台:Windows、macOS、Linux、Android、iOS
服务端搭建
安装 Sing-box
# 一键安装脚本
curl -fsSL https://sing-box.app/deb-install.sh | bash
# 或手动安装
wget https://github.com/SagerNet/sing-box/releases/latest/download/sing-box-linux-amd64.tar.gz
tar -xzf sing-box-linux-amd64.tar.gz
mv sing-box /usr/local/bin/
服务端配置示例
{
"log": {"level": "info"},
"inbounds": [
{
"type": "vmess",
"listen": "::",
"listen_port": 443,
"users": [{"uuid": "your-uuid"}],
"transport": {"type": "ws", "path": "/ws"}
}
],
"outbounds": [{"type": "direct"}]
}
客户端配置
Windows/macOS
下载 SFA(Sing-box for Android)或 SFI(Sing-box for iOS),导入订阅链接即可。
配置文件示例
{
"dns": {
"servers": [{"tag": "google", "address": "https://8.8.8.8/dns-query"}]
},
"inbounds": [{"type": "mixed", "listen": "127.0.0.1", "listen_port": 7890}],
"outbounds": [
{"type": "vmess", "server": "your-server.com", "server_port": 443, "uuid": "your-uuid"},
{"type": "direct", "tag": "direct"}
],
"route": {
"rules": [{"geosite": "cn", "outbound": "direct"}]
}
}
性能优化
- 启用
tcp_fast_open减少握手延迟 - 使用
utls指纹伪装绕过 TLS 检测 - 配置
mux多路复用提升并发性能
发表回复