用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) = reality 
SNI (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-actions
FATAL[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用)

评论

The Hot3 in Last 7 Days

酒馆SillyTavern 玩英文角色卡 也能以中文输出 设置世界书Lorebooks

Woiden IPv6 VPS 搭 V2ray 梯子 VLESS+Websocket+TLS 模式 免费 白嫖 全程手机操作 2022-4-19