Skip to content

fix: parse ech-opts.config from Clash Meta YAML subscriptions#1173

Open
xtgm wants to merge 1 commit intoMatsuriDayo:mainfrom
xtgm:fix/ech-opts-config-parsing
Open

fix: parse ech-opts.config from Clash Meta YAML subscriptions#1173
xtgm wants to merge 1 commit intoMatsuriDayo:mainfrom
xtgm:fix/ech-opts-config-parsing

Conversation

@xtgm
Copy link
Copy Markdown

@xtgm xtgm commented Apr 24, 2026

Summary

Fixes #1115, Fixes #1131

The Clash YAML parser in RawUpdater.kt currently only reads ech-opts.enable but silently drops ech-opts.config. This causes ECH to be enabled without the actual ECH configuration data, making ECH non-functional for Clash Meta subscriptions.

The fix adds a "config" branch to the when block, storing the value in bean.echConfig.

The rest of the pipeline already works:

  • StandardV2RayBean.java has the echConfig field
  • V2RayFmt.kt (buildSingBoxOutboundTLS) already checks bean.echConfig.isNotBlank() and passes it to sing-box's OutboundECHOptions.config

Only RawUpdater.kt was missing the parsing step.


概要

修复 #1115#1131

RawUpdater.kt 中的 Clash YAML 解析器目前只读取 ech-opts.enable,但丢弃了 ech-opts.config。这导致 ECH 虽然被启用,但没有实际的 ECH 配置数据,使得通过 Clash Meta 订阅导入的节点 ECH 功能无法生效。

修复方案:在 when 块中添加 "config" 分支,将值写入 bean.echConfig

数据链路的其余部分已经正常工作:

  • StandardV2RayBean.java 已有 echConfig 字段
  • V2RayFmt.ktbuildSingBoxOutboundTLS)已正确检查 bean.echConfig.isNotBlank() 并传递给 sing-box 的 OutboundECHOptions.config

唯一缺失的就是 RawUpdater.kt 的解析步骤。

Changes

 "ech-opts" -> (opt.value as? Map<String, Any?>)?.also {
     for (echOpt in it) {
         when (echOpt.key) {
             "enable" -> bean.enableECH =
                 echOpt.value.toString() == "true"
+
+            "config" -> bean.echConfig =
+                echOpt.value?.toString() ?: ""
         }
     }
 }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: 不认识nekoray,V2rayng的ech选项 BUG: 不认识clash meta的ech-opts选项

1 participant