mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-11-03 03:35:04 +03:00
fix(sub): preserve external Hysteria2 Clash options (#6944)
An external hy2:// link turned into a bare Clash Hysteria2 node: obfs, obfs-password, the port-hopping range and the certificate pin were dropped, so Mihomo could not reach servers that require them. External and panel Hysteria2 nodes now share one converter.
This commit is contained in:
@@ -131,17 +131,9 @@ func clashHysteriaFromExternal(settings, stream map[string]any, name string) map
|
||||
"password": auth,
|
||||
"udp": true,
|
||||
}
|
||||
if tls, _ := stream["tlsSettings"].(map[string]any); tls != nil {
|
||||
if sni, _ := tls["serverName"].(string); sni != "" {
|
||||
proxy["sni"] = sni
|
||||
}
|
||||
if alpn := clashStringList(tls["alpn"]); len(alpn) > 0 {
|
||||
proxy["alpn"] = alpn
|
||||
}
|
||||
if fp, _ := tls["fingerprint"].(string); fp != "" {
|
||||
proxy["client-fingerprint"] = fp
|
||||
}
|
||||
}
|
||||
tls, _ := stream["tlsSettings"].(map[string]any)
|
||||
applyHysteriaTLS(proxy, tls, tls)
|
||||
applyHysteriaFinalMask(proxy, stream)
|
||||
return proxy
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user