Open
Conversation
- url-to-clash.js: VLESS/Trojan/Hysteria2/TUIC 解析器输出字段从 sni 改为 servername,符合 Clash/Mihomo 标准 - builtin-clash-generator.js: js-yaml forceQuotes 改为 true,修复 emoji 名称引号丢失 - CopyLinkModal.vue: Clash 复制链接改为 ?target=clash&builtin=1,使用内置生成器保留 reality-opts 等参数
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.
问题描述
内置 Clash 生成器输出的 YAML 配置存在以下三个问题:
1.
servername字段被错误输出为sniurl-to-clash.js 中 VLESS、Trojan、Hysteria2、TUIC 协议解析器将 SNI 参数存储为
proxy.sni,但 Clash/Mihomo 配置标准字段为servername(VMess 解析器已正确使用servername,其余四个协议不一致)。2.
name字段引号丢失builtin-clash-generator.js 中
js-yaml的forceQuotes设为false,导致含有 emoji 等特殊字符的节点名称在序列化时丢失引号,可能造成部分客户端解析异常。3. 复制订阅链接的 Clash 模式经过 subconverter 导致参数丢失
CopyLinkModal.vue 中 Clash 格式的链接参数为
?clash,会经过外部 subconverter 后端转换。subconverter 不支持reality-opts(含spider-x)、dialer-proxy等特殊参数,导致这些参数在转换过程中被丢弃。而 useProfiles.js 中的 copyClashLink 已经正确使用了?target=clash&builtin=1,两者不一致。修改内容
functions/utils/url-to-clash.js
将以下四个协议解析函数中的
proxy.sni统一改为proxy.servername:proxy.sni→proxy.servernameproxy.sni→proxy.servernameproxy.sni→proxy.servernameproxy.sni→proxy.servernamefunctions/modules/subscription/builtin-clash-generator.js
let yamlStr = yaml.dump(config, { indent: 2, lineWidth: -1, noRefs: true, quotingType: '"', - forceQuotes: false + forceQuotes: true });src/components/modals/CopyLinkModal.vue
与 useProfiles.js 中的 copyClashLink 保持一致,走内置 Clash 生成器路径。
影响范围
#269 新版本解析后无法使用节点