用VS Code阅读Sing-box文档 生成配置文件
前言
有群友问 怎么手搓 Sing-box 的配置文件
思路
把文档丢给GPT, 让GPT帮忙写配置文件
实践
0. 准备环境
安装 Antigravity
* 这里只是拿TA作为例子, 当然还有其它 VS Code 可选.
建个目录 作为工作目录, 用 Antigravity 打开
1. 下载文档
发给GPT
下载这个项目的文档 https://sing-box.sagernet.org/configuration/
我假设自己是一个小白, 所有需要我批准的请求, 我都批准.
2. 生成配置文件
发给GPT
生成一个作为客户端使用的配置文件监听本地 1080 端口 socks 作为inbound连接一个下面这样参数的reality协议节点作为 outbound协议 (protocol) = vless地址 (address) = 74.48.9.95端口 (port) = 8972用户ID (id) = fb0d60cf-1084-412d-ba59-fd5c1166b89d流控 (flow) = xtls-rprx-vision传输协议 (network) = tcp传输层安全 (TLS) = realitySNI (serverName) = www.paypal.com指纹 (Fingerprint) = chrome公钥 (Public key) = Qam0-DVzhHghfZPi4Pfx3iQbmVt0YJBhcb0cyMsFdEc
生成了一个配置文件 config.json
调试
下载sing-box的可执行文件 放到 工作目录
启动 sing-box 内核
sing-box.exe run
报错
ERROR[0000] legacy special outbounds is deprecated in sing-box 1.11.0 and will be removed in sing-box 1.13.0, checkout documentation for migration: https://sing-box.sagernet.org/migration/#migrate-legacy-special-outbounds-to-rule-actionsFATAL[0000] to continuing using this feature, set environment variable ENABLE_DEPRECATED_SPECIAL_OUTBOUNDS=true
把报错信息 原样 全部 复制粘贴给GPT
更新了配置文件 config.json
再试试启动 sing-box 内核, 成功运行.
新开一个命令行 访问 墙外域名
curl -x socks5h://127.0.0.1:1080 google.com
成功
========
后记
常见的 VS Code (AI用)M$ VS Code
Windsurf
Antigravity


评论
发表评论