JSON 格式化、语法检查与树形折叠
快速整理复杂的多节点 config.json,即时定位多余逗号或引号缺失等语法问题,并以可折叠树形视图审阅 DNS、Inbounds、Outbounds 与 Route 层级。
100% 浏览器本地内存运行:您的配置文件、UUID 与节点密码不会上传至任何服务器。
需要官方 Schema 结构校验?前往配置校验器 →JSON 语法检查通过(字符数:2,260,顶层键:$schema, log, dns, inbounds, outbounds, route, experimental)。注:本工具检查 RFC 8259 JSON 语法;Sing-box 字段规范校验请使用 官方 Schema 配置校验器。
原始 JSON 输入区104 行
树形结构预览(支持折叠与展开)
"$schema":"https://sing-box.sagernet.org/schema.json"
"level":"info"
"timestamp":true
}
"tag":"dns-local"
"type":"https"
"server":"223.5.5.5"
}
"tag":"dns-remote"
"type":"https"
"server":"1.1.1.1"
"detour":"proxy"
}
]
"rule_set":"geosite-cn"
"server":"dns-local"
}
]
"final":"dns-remote"
"optimistic":true
}
"type":"mixed"
"tag":"mixed-in"
"listen":"127.0.0.1"
"listen_port":7890
}
"type":"tun"
"tag":"tun-in"
"172.18.0.1/30"
]
"auto_route":true
"strict_route":true
}
]
"type":"selector"
"tag":"proxy"
"node-example"
"direct"
]
"default":"node-example"
}
"type":"vless"
"tag":"node-example"
"server":"example.com"
"server_port":443
"uuid":"00000000-0000-0000-0000-000000000000"
"enabled":true
"server_name":"example.com"
}
}
"type":"direct"
"tag":"direct"
}
]
"auto_detect_interface":true
"default_domain_resolver":"dns-local"
"action":"sniff"
}
"protocol":"dns"
"action":"hijack-dns"
}
"ip_is_private":true
"outbound":"direct"
}
"geosite-cn"
"geoip-cn"
]
"outbound":"direct"
}
]
"tag":"geosite-cn"
"type":"remote"
"format":"binary"
"url":"https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-cn.srs"
"detour":"proxy"
}
}
"tag":"geoip-cn"
"type":"remote"
"format":"binary"
"url":"https://raw.githubusercontent.com/SagerNet/sing-geoip/rule-set/geoip-cn.srs"
"detour":"proxy"
}
}
]
"final":"proxy"
}
"enabled":true
}
}
}
Sing-box 常用配置字段速查
快速检索顶层结构与 v1.12–v1.14 核心配置键含义。
| 配置字段 | 所属模块 | 类型 | 作用说明 |
|---|---|---|---|
| $schema | 顶层 | string | 指向官方 JSON Schema,用于编辑器自动补全与静态校验 |
| log.level | log | trace|debug|info|warn|error | 日志输出等级,排错时建议设为 debug,日常设为 info 或 warn |
| dns.servers | dns | array | v1.12+ 采用 type 字段声明服务器类型(https/tls/udp/local/fakeip) |
| dns.optimistic | dns | boolean|object | v1.14+ 新增:启用乐观 DNS 缓存,过期缓存后台刷新零等待 |
| inbounds[].type | inbounds | string | 入站类型:tun / mixed / socks / http / direct / redirect / tproxy |
| inbounds[].address | inbounds (tun) | string[] | v1.10+ 合并字段,替代旧版 inet4_address / inet6_address |
| outbounds[].type | outbounds | string | 出站类型:direct / selector / urltest / shadowsocks / vless / trojan / hysteria2 / tuic |
| route.rules[].action | route | string | v1.11+ 路由动作:route / reject / hijack-dns / sniff / resolve / bypass |
| route.rule_set | route | array | 本地或远程规则集定义列表(推荐 binary .srs 格式) |
| route.default_domain_resolver | route | string|object | v1.12+ 默认域名解析器,用于解析代理服务器域名与直连域名 |
| route.auto_detect_interface | route | boolean | 桌面端开启 TUN 时必须设为 true 以防路由环路 |
| experimental.cache_file | experimental | object | 启用 cache.db 持久化节点选择、远程规则集缓存与 FakeIP 映射 |