diff --git a/v2rayN/ServiceLib/Manager/ActionPrecheckManager.cs b/v2rayN/ServiceLib/Manager/ActionPrecheckManager.cs
index 73a1020a..52de0cd3 100644
--- a/v2rayN/ServiceLib/Manager/ActionPrecheckManager.cs
+++ b/v2rayN/ServiceLib/Manager/ActionPrecheckManager.cs
@@ -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;
}
diff --git a/v2rayN/ServiceLib/Resx/ResUI.Designer.cs b/v2rayN/ServiceLib/Resx/ResUI.Designer.cs
index 64ca0292..a3b75407 100644
--- a/v2rayN/ServiceLib/Resx/ResUI.Designer.cs
+++ b/v2rayN/ServiceLib/Resx/ResUI.Designer.cs
@@ -19,7 +19,7 @@ namespace ServiceLib.Resx {
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "18.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
public class ResUI {
@@ -78,6 +78,15 @@ namespace ServiceLib.Resx {
}
}
+ ///
+ /// 查找类似 ALPN must contain 'http/1.1' when using WebSocket with TLS. 的本地化字符串。
+ ///
+ public static string AlpnMustContainHttp11ForWsTls {
+ get {
+ return ResourceManager.GetString("AlpnMustContainHttp11ForWsTls", resourceCulture);
+ }
+ }
+
///
/// 查找类似 Export share link to clipboard successfully 的本地化字符串。
///
diff --git a/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx b/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx
index 4f5467b3..9571ecd9 100644
--- a/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx
+++ b/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx
@@ -1641,4 +1641,7 @@ The "Get Certificate" action may fail if a self-signed certificate is used or if
Configuration Item 2, Select and add from self-built
+
+ ALPN must contain 'http/1.1' when using WebSocket with TLS.
+
\ No newline at end of file
diff --git a/v2rayN/ServiceLib/Resx/ResUI.fr.resx b/v2rayN/ServiceLib/Resx/ResUI.fr.resx
index a4fbf84b..e17f56b9 100644
--- a/v2rayN/ServiceLib/Resx/ResUI.fr.resx
+++ b/v2rayN/ServiceLib/Resx/ResUI.fr.resx
@@ -1638,4 +1638,7 @@ Si un certificat auto-signé est utilisé ou si le système contient une CA non
Configuration Item 2, Select and add from self-built
+
+ ALPN must contain 'http/1.1' when using WebSocket with TLS.
+
\ No newline at end of file
diff --git a/v2rayN/ServiceLib/Resx/ResUI.hu.resx b/v2rayN/ServiceLib/Resx/ResUI.hu.resx
index 0841b111..c7f6d51c 100644
--- a/v2rayN/ServiceLib/Resx/ResUI.hu.resx
+++ b/v2rayN/ServiceLib/Resx/ResUI.hu.resx
@@ -1641,4 +1641,7 @@ The "Get Certificate" action may fail if a self-signed certificate is used or if
Configuration Item 2, Select and add from self-built
+
+ ALPN must contain 'http/1.1' when using WebSocket with TLS.
+
\ No newline at end of file
diff --git a/v2rayN/ServiceLib/Resx/ResUI.resx b/v2rayN/ServiceLib/Resx/ResUI.resx
index ceb7c91e..ce09f3f6 100644
--- a/v2rayN/ServiceLib/Resx/ResUI.resx
+++ b/v2rayN/ServiceLib/Resx/ResUI.resx
@@ -1641,4 +1641,7 @@ The "Get Certificate" action may fail if a self-signed certificate is used or if
Configuration Item 2, Select and add from self-built
+
+ ALPN must contain 'http/1.1' when using WebSocket with TLS.
+
\ No newline at end of file
diff --git a/v2rayN/ServiceLib/Resx/ResUI.ru.resx b/v2rayN/ServiceLib/Resx/ResUI.ru.resx
index 33102733..d502ff35 100644
--- a/v2rayN/ServiceLib/Resx/ResUI.ru.resx
+++ b/v2rayN/ServiceLib/Resx/ResUI.ru.resx
@@ -1641,4 +1641,7 @@ The "Get Certificate" action may fail if a self-signed certificate is used or if
Configuration Item 2, Select and add from self-built
+
+ ALPN must contain 'http/1.1' when using WebSocket with TLS.
+
\ No newline at end of file
diff --git a/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx b/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx
index e53c4203..a5673430 100644
--- a/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx
+++ b/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx
@@ -1638,4 +1638,7 @@
子配置项二,从自建中选择添加
+
+ 使用 WebSocket+TLS 时,ALPN 必须包含 'http/1.1'。
+
\ No newline at end of file
diff --git a/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx b/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx
index 92421199..1a4ec70c 100644
--- a/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx
+++ b/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx
@@ -1638,4 +1638,7 @@
子配置項二,從自建中選擇新增
+
+ ALPN must contain 'http/1.1' when using WebSocket with TLS.
+
\ No newline at end of file