tindy2013/subconverter

GitHub: tindy2013/subconverter

一款用于在不同代理订阅格式之间进行转换的工具,支持Clash、V2Ray、Surge、Quantumult等多种主流代理客户端配置文件的互相转换和合并。

Stars: 16245 | Forks: 3692

# subconverter 用于在不同代理订阅格式之间进行转换的工具。 [![构建状态](https://static.pigsec.cn/wp-content/uploads/repos/2026/04/825064cfd3160936.svg)](https://github.com/tindy2013/subconverter/actions) [![GitHub 标签(最新语义化版本)](https://img.shields.io/github/tag/tindy2013/subconverter.svg)](https://github.com/tindy2013/subconverter/tags) [![GitHub 发布](https://img.shields.io/github/release/tindy2013/subconverter.svg)](https://github.com/tindy2013/subconverter/releases) [![GitHub 许可证](https://img.shields.io/github/license/tindy2013/subconverter.svg)](https://github.com/tindy2013/subconverter/blob/master/LICENSE) [Docker README](https://github.com/tindy2013/subconverter/blob/master/README-docker.md) [中文文档](https://github.com/tindy2013/subconverter/blob/master/README-cn.md) - [subconverter](#subconverter) - [支持的类型](#supported-types) - [快速使用](#quick-usage) - [访问接口](#access-interface) - [说明](#description) - [高级用法](#advanced-usage) - [自动上传](#auto-upload) ## 支持的类型 | 类型 | 作为源 | 作为目标 | 目标名称 | | ------------ | :--------: | :----------: | ----------- | | Clash | ✓ | ✓ | clash | | ClashR | ✓ | ✓ | clashr | | Quantumult | ✓ | ✓ | quan | | Quantumult X | ✓ | ✓ | quanx | | Loon | ✓ | ✓ | loon | | SS (SIP002) | ✓ | ✓ | ss | | SS Android | ✓ | ✓ | sssub | | SSD | ✓ | ✓ | ssd | | SSR | ✓ | ✓ | ssr | | Surfboard | ✓ | ✓ | surfboard | | Surge 2 | ✓ | ✓ | surge&ver=2 | | Surge 3 | ✓ | ✓ | surge&ver=3 | | Surge 4 | ✓ | ✓ | surge&ver=4 | | V2Ray | ✓ | ✓ | v2ray | | 类 Telegram 的 HTTP/Socks 5 链接 | ✓ | × | 仅作为源 | 注意: 1. Shadowrocket 用户应使用 `ss`、`ssr` 或 `v2ray` 作为目标。 2. 您可以在类 Telegram 的 HTTP/Socks 5 链接中添加 `&remark=` 来设置该节点的备注。例如: - tg://http?server=1.2.3.4&port=233&user=user&pass=pass&remark=示例 - https://t.me/http?server=1.2.3.4&port=233&user=user&pass=pass&remark=示例 ## 快速使用 ### 访问接口 ``` http://127.0.0.1:25500/sub?target=%TARGET%&url=%URL%&config=%CONFIG% ``` ### 说明 | 参数 | 必需 | 示例 | 描述 | | -------- | :------: | :------ | ----------- | | target | 是 | clash | 目标订阅类型。从[支持的类型](#supported-types)中的目标名称获取。 | | url | 是 | https%3A%2F%2Fwww.xxx.com | 要转换的订阅。支持 URL 和文件路径。需要先使用 [URLEncode](https://www.urlencoder.org/) 进行处理。 | | config | 否 | https%3A%2F%2Fwww.xxx.com | 外部配置文件路径。支持 URL 和文件路径。需要先使用 [URLEncode](https://www.urlencoder.org/) 进行处理。更多示例可以在[此](https://github.com/lzdnico/subconverteriniexample)仓库中找到。 | 如果需要合并两个或更多订阅,您应该在 URLEncode 处理之前用 '|' 将它们连接起来。 示例: ``` You have 2 subscriptions and you want to merge them and generate a Clash subscription: 1. https://dler.cloud/subscribe/ABCDE?clash=vmess 2. https://rich.cloud/subscribe/ABCDE?clash=vmess First use '|' to separate 2 subscriptions: https://dler.cloud/subscribe/ABCDE?clash=vmess|https://rich.cloud/subscribe/ABCDE?clash=vmess Then process it with URLEncode to get %URL%: https%3A%2F%2Fdler.cloud%2Fsubscribe%2FABCDE%3Fclash%3Dvmess%7Chttps%3A%2F%2Frich.cloud%2Fsubscribe%2FABCDE%3Fclash%3Dvmess Then fill %TARGET% and %URL% in Access Interface with actual values: http://127.0.0.1:25500/sub?target=clash&url=https%3A%2F%2Fdler.cloud%2Fsubscribe%2FABCDE%3Fclash%3Dvmess%7Chttps%3A%2F%2Frich.cloud%2Fsubscribe%2FABCDE%3Fclash%3Dvmess Finally subscribe this link in Clash and you are done! ``` ## 高级用法 请参考[中文文档](https://github.com/tindy2013/subconverter/blob/master/README-cn.md#%E8%BF%9B%E9%98%B6%E7%94%A8%E6%B3%95)。 ## 自动上传 在根目录的 [gistconf.ini](./gistconf.ini) 中添加一个[个人访问令牌](https://github.com/settings/tokens/new),然后在本地订阅链接中添加 `&upload=true`,当您访问此链接时,程序将自动更新内容到 Gist 仓库。 示例: ``` [common] ;uncomment the following line and enter your token to enable upload function token = xxxxxxxxxxxxxxxxxxxxxxxx(Your Personal Access Token) ```
标签:Clash, ClashR, Loon, Python脚本, Quantumult, Quantumult X, SS, SSR, Surfboard, Surge, 代理工具, 代理订阅, 代理转换, 代理配置, 安全合规, 日志审计, 机场订阅, 格式转换, 科学上网, 网络代理, 网络工具, 订阅转换, 请求拦截, 配置文件转换