Add TLS ALPN check for WS (#8469)

This commit is contained in:
DHR60
2025-12-09 20:22:13 +08:00
committed by GitHub
parent 7cee98887b
commit 6e27dca6cd
9 changed files with 44 additions and 1 deletions
@@ -193,6 +193,19 @@ public class ActionPrecheckManager
}
}
// ws with tls, tls alpn should contain "http/1.1" in xray core
// rfc6455
// https://github.com/XTLS/Xray-core/blob/81f8f398c7b2b845853b1e85087c6122acc6db0b/transport/internet/tls/tls.go#L95-L116
if (item.Network == nameof(ETransport.ws)
&& item.StreamSecurity == Global.StreamSecurity)
{
var alpnList = Utils.String2List(item.Alpn) ?? [];
if (alpnList.Count > 0 && !alpnList.Contains("http/1.1"))
{
errors.Add(ResUI.AlpnMustContainHttp11ForWsTls);
}
}
return errors;
}