ech for clash sub #770

This commit is contained in:
Alireza Ahmadi
2025-10-04 22:21:40 +02:00
parent 64979e6725
commit 7b979b95d4
+13 -4
View File
@@ -216,10 +216,6 @@ func (s *ClashService) ConvertToClashMeta(outbounds *[]map[string]interface{}) (
} }
} }
if isTls { if isTls {
// ignore ech outbounds
if _, ok := tls["ech"].(interface{}); ok {
continue
}
proxy["tls"] = tls["enabled"] proxy["tls"] = tls["enabled"]
// ALPN if exists // ALPN if exists
@@ -255,6 +251,19 @@ func (s *ClashService) ConvertToClashMeta(outbounds *[]map[string]interface{}) (
if insecure, ok := tls["insecure"].(bool); ok && insecure { if insecure, ok := tls["insecure"].(bool); ok && insecure {
proxy["skip-cert-verify"] = insecure proxy["skip-cert-verify"] = insecure
} }
// ech outbounds
if ech, ok := tls["ech"].(interface{}); ok {
ech_data, _ := ech.(map[string]interface{})
ech_config, _ := ech_data["config"].([]interface{})
ech_string := ""
for i := 1; i < len(ech_config)-1; i++ {
ech_string += ech_config[i].(string)
}
proxy["ech-opts"] = map[string]interface{}{
"enable": true,
"config": ech_string,
}
}
} }
// Transport if exist // Transport if exist