Repository navigation
Conversation
为支持 Ring 客户端直接拉取并解析 Sub-Store 订阅,按 Ring Core INI 配置契约实现目标平台识别与代理节点转换器(Ring / ring): - 注册 Ring 平台 Producer 与 User-Agent 自动识别,放行携带 Ring 传输层插件的 Shadowsocks over TLS 节点及 HTTP 根级请求头 - 支持 Shadowsocks、VMess、VLESS、Trojan、Hysteria / Hysteria2、TUIC、WireGuard、AnyTLS、Tailscale、SSH、HTTP、SOCKS5 及 direct 基础策略转换 - 对齐传输层与安全扩展契约,涵盖 REALITY、XHTTP(含 xhttp-download 独立上下行与 HTTP/3 校验)、WebSocket、gRPC、ShadowTLS / ShadowQUIC / JLS 插件、Sing Mux 多路复用、证书 SHA-256 指纹及通用连接参数 - 补充完整的协议转换、脚本算子联动与配置契约单元测试
Member
Author
Orvaxis
force-pushed
the
feat/ring-adapter
branch
from
November 16, 2026 04:00
36db6dc to
af3bb52
Compare
Orvaxis
marked this pull request as draft
November 16, 2026 04:00
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


背景与客户端介绍
Ring 是一款现代化的多协议网络代理工具,采用类 INI 的行级键值配置格式(
[Proxy]段落),支持自定义分流规则、灵活的域名解析策略与丰富的传输层安全扩展。本 PR 为 Sub-Store 后端新增
Ring(及小写别名ring)目标平台适配器,使 Ring 客户端可通过User-Agent自动识别或显式参数?target=Ring直接拉取并转换订阅节点。主要变更
平台注册与识别
在 Producer 注册表中新增
Ring/ring目标平台(backend/src/core/proxy-utils/producers/ring.js、producers/index.js)。在
getPlatformFromUserAgent中支持识别包含ring的客户端User-Agent(backend/src/utils/user-agent.js)。在通用转换管线中为
Ring平台放行携带受支持传输插件的 Shadowsocks over TLS 节点,并保留 HTTP 代理的根级自定义请求头(backend/src/core/proxy-utils/index.js)。新增
formatRingVmessCipher归一化 VMess 加密套件名称(backend/src/core/proxy-utils/vmess-security.js)。支持的代理协议与策略
主流代理协议:
Shadowsocks(ss)、VMess、VLESS、Trojan、Hysteria/Hysteria2、TUIC、ShadowQUIC、WireGuard、AnyTLS通用与隧道协议:
HTTP/HTTPS、SOCKS5、SSH、Tailscale基础策略:
direct传输层、安全与连接扩展
传输层与插件:
TCP、WebSocket(含 Early Data 与自定义请求头)、gRPC、XHTTP(支持xhttp-download独立上下行分离与 HTTP/3 ALPN约束校验)、
simple-obfs、ShadowTLS(v2/v3)、ShadowQUIC/JLS插件TLS 与抗审查特性:
REALITY(公钥 URL-safe 规范化与客户端指纹能力校验)、XTLS Vision、uTLS客户端指纹、服务端证书 SHA-256 指纹连接与多路复用:
Sing Mux(兼容顶层字段、Sing-boxsmux与 Mihomomultiplex结构)、AnyTLS 连接池参数、ip-version(prefer-ipv4/ipv4-only/prefer-ipv6/ipv6-only)、tfo、interface-name等使用方式
客户端自动识别:在 Ring 客户端中直接添加 Sub-Store 订阅链接,后端将根据
User-Agent自动输出 Ring 格式节点列表。显式指定目标平台:在订阅链接后附加
?target=Ring(或?target=ring),也可在脚本操作/过滤器中通过targetPlatform === 'Ring'进行针对性处理。测试验证
新增并补充了完整的单元测试与配置契约测试:
backend/src/test/proxy-producers/ring.spec.js:覆盖各协议转换、User-Agent识别、端到端ProxyUtils.produce过滤及脚本算子/过滤器联动。backend/src/test/proxy-producers/ring-contract.spec.js:覆盖特殊字符引号转义、换行注入防护、布尔/数值边界及协议契约约束。backend/src/test/proxy-producers/text.spec.js:补充文本类 Producer 集成回归用例。