SplitHTTP is now XHTTP for xray

pull/6079/head
2dust 2 weeks ago
parent 2de9e14c7d
commit 04efed2079

@ -7,6 +7,7 @@
ws,
httpupgrade,
splithttp,
xhttp,
h2,
http,
quic,

@ -178,7 +178,7 @@
public static readonly List<string> SsSecuritiesInXray = new() { "aes-256-gcm", "aes-128-gcm", "chacha20-poly1305", "chacha20-ietf-poly1305", "xchacha20-poly1305", "xchacha20-ietf-poly1305", "none", "plain", "2022-blake3-aes-128-gcm", "2022-blake3-aes-256-gcm", "2022-blake3-chacha20-poly1305" };
public static readonly List<string> SsSecuritiesInSingbox = new() { "aes-256-gcm", "aes-192-gcm", "aes-128-gcm", "chacha20-ietf-poly1305", "xchacha20-ietf-poly1305", "none", "2022-blake3-aes-128-gcm", "2022-blake3-aes-256-gcm", "2022-blake3-chacha20-poly1305", "aes-128-ctr", "aes-192-ctr", "aes-256-ctr", "aes-128-cfb", "aes-192-cfb", "aes-256-cfb", "rc4-md5", "chacha20-ietf", "xchacha20" };
public static readonly List<string> Flows = new() { "", "xtls-rprx-vision", "xtls-rprx-vision-udp443" };
public static readonly List<string> Networks = new() { "tcp", "kcp", "ws", "httpupgrade", "splithttp", "h2", "quic", "grpc" };
public static readonly List<string> Networks = new() { "tcp", "kcp", "ws", "httpupgrade", "xhttp", "splithttp", "h2", "quic", "grpc" };
public static readonly List<string> KcpHeaderTypes = new() { "srtp", "utp", "wechat-video", "dtls", "wireguard" };
public static readonly List<string> CoreTypes = new() { "v2fly", "Xray", "sing_box" };
public static readonly List<string> CoreTypes4VLESS = new() { "Xray", "sing_box" };

@ -84,6 +84,7 @@ namespace ServiceLib.Handler.Fmt
case nameof(ETransport.ws):
case nameof(ETransport.httpupgrade):
case nameof(ETransport.splithttp):
case nameof(ETransport.xhttp):
if (Utils.IsNotEmpty(item.RequestHost))
{
dicQuery.Add("host", Utils.UrlEncode(item.RequestHost));
@ -157,6 +158,7 @@ namespace ServiceLib.Handler.Fmt
case nameof(ETransport.ws):
case nameof(ETransport.httpupgrade):
case nameof(ETransport.splithttp):
case nameof(ETransport.xhttp):
item.RequestHost = Utils.UrlDecode(query["host"] ?? "");
item.Path = Utils.UrlDecode(query["path"] ?? "/");
break;

@ -258,7 +258,7 @@ namespace ServiceLib.Models
public HttpupgradeSettings4Ray? httpupgradeSettings { get; set; }
public SplithttpSettings4Ray? splithttpSettings { get; set; }
public XhttpSettings4Ray? xhttpSettings { get; set; }
public HttpSettings4Ray? httpSettings { get; set; }
@ -344,15 +344,22 @@ namespace ServiceLib.Models
public string? host { get; set; }
}
public class SplithttpSettings4Ray
public class XhttpSettings4Ray
{
public string? path { get; set; }
public string? host { get; set; }
public string? scMaxEachPostBytes { get; set; }
public string? scMaxConcurrentPosts { get; set; }
public string? scMinPostsIntervalMs { get; set; }
public Xmux4Ray? xmux { get; set; }
}
public int? maxUploadSize { get; set; }
public int? maxConcurrentUploads { get; set; }
public class Xmux4Ray
{
public int? maxConcurrency { get; set; }
public int? maxConnections { get; set; }
public int? cMaxReuseTimes { get; set; }
public int? cMaxLifetimeMs { get; set; }
}
public class HttpSettings4Ray

@ -3734,7 +3734,7 @@ namespace ServiceLib.Resx {
}
/// <summary>
/// 查找类似 *ws/httpupgrade/splithttp path 的本地化字符串。
/// 查找类似 *ws/httpupgrade/xhttp path 的本地化字符串。
/// </summary>
public static string TransportPathTip1 {
get {
@ -3788,7 +3788,7 @@ namespace ServiceLib.Resx {
}
/// <summary>
/// 查找类似 *ws/httpupgrade/splithttp host 的本地化字符串。
/// 查找类似 *ws/httpupgrade/xhttp host 的本地化字符串。
/// </summary>
public static string TransportRequestHostTip2 {
get {

@ -344,7 +344,7 @@
<value>Please fill in the correct custom DNS</value>
</data>
<data name="TransportPathTip1" xml:space="preserve">
<value>*ws/httpupgrade/splithttp path</value>
<value>*ws/httpupgrade/xhttp path</value>
</data>
<data name="TransportPathTip2" xml:space="preserve">
<value>*h2 path</value>
@ -359,7 +359,7 @@
<value>*http host Separated by commas (,)</value>
</data>
<data name="TransportRequestHostTip2" xml:space="preserve">
<value>*ws/httpupgrade/splithttp host</value>
<value>*ws/httpupgrade/xhttp host</value>
</data>
<data name="TransportRequestHostTip3" xml:space="preserve">
<value>*h2 host Separated by commas (,)</value>

@ -344,7 +344,7 @@
<value>请填写正确的自定义DNS</value>
</data>
<data name="TransportPathTip1" xml:space="preserve">
<value>*ws/httpupgrade/splithttp path</value>
<value>*ws/httpupgrade/xhttp path</value>
</data>
<data name="TransportPathTip2" xml:space="preserve">
<value>*h2 path</value>
@ -359,7 +359,7 @@
<value>*http host中间逗号(,)分隔</value>
</data>
<data name="TransportRequestHostTip2" xml:space="preserve">
<value>*ws/httpupgrade/splithttp host</value>
<value>*ws/httpupgrade/xhttp host</value>
</data>
<data name="TransportRequestHostTip3" xml:space="preserve">
<value>*h2 host中间逗号(,)分隔</value>

@ -343,7 +343,7 @@
<value>請填寫正確的自訂DNS</value>
</data>
<data name="TransportPathTip1" xml:space="preserve">
<value>*ws/httpupgrade/splithttp path</value>
<value>*ws/httpupgrade/xhttp path</value>
</data>
<data name="TransportPathTip2" xml:space="preserve">
<value>*h2 path</value>
@ -358,7 +358,7 @@
<value>*http host中間逗號(,)分隔</value>
</data>
<data name="TransportRequestHostTip2" xml:space="preserve">
<value>*ws/httpupgrade/splithttp host</value>
<value>*ws/httpupgrade/xhttp host</value>
</data>
<data name="TransportRequestHostTip3" xml:space="preserve">
<value>*h2 host中間逗號(,)分隔</value>

@ -26,7 +26,7 @@ namespace ServiceLib.Services.CoreConfig
ret.Msg = ResUI.CheckServerSettings;
return ret;
}
if (node.GetNetwork() is nameof(ETransport.kcp) or nameof(ETransport.splithttp))
if (node.GetNetwork() is nameof(ETransport.kcp) or nameof(ETransport.splithttp) or nameof(ETransport.xhttp))
{
ret.Msg = ResUI.Incorrectconfiguration + $" - {node.GetNetwork()}";
return ret;

@ -926,23 +926,26 @@ namespace ServiceLib.Services.CoreConfig
streamSettings.httpupgradeSettings = httpupgradeSettings;
break;
//splithttp
//splithttp //xhttp
case nameof(ETransport.splithttp):
SplithttpSettings4Ray splithttpSettings = new()
case nameof(ETransport.xhttp):
streamSettings.network = ETransport.xhttp.ToString();
XhttpSettings4Ray xhttpSettings = new()
{
maxUploadSize = 1000000,
maxConcurrentUploads = 10
scMaxEachPostBytes = "500000-1000000",
scMaxConcurrentPosts = "50-100",
scMinPostsIntervalMs = "30-50"
};
if (Utils.IsNotEmpty(node.Path))
{
splithttpSettings.path = node.Path;
xhttpSettings.path = node.Path;
}
if (Utils.IsNotEmpty(host))
{
splithttpSettings.host = host;
xhttpSettings.host = host;
}
streamSettings.splithttpSettings = splithttpSettings;
streamSettings.xhttpSettings = xhttpSettings;
break;
//h2

@ -31,7 +31,7 @@
await Task.Delay(1000);
try
{
if (!_config.IsRunningCore(ECoreType.Xray))
if (_config.RunningCoreType != ECoreType.Xray)
{
continue;
}

@ -338,6 +338,7 @@ namespace v2rayN.Desktop.Views
case nameof(ETransport.ws):
case nameof(ETransport.httpupgrade):
case nameof(ETransport.splithttp):
case nameof(ETransport.xhttp):
tipRequestHost.Text = ResUI.TransportRequestHostTip2;
tipPath.Text = ResUI.TransportPathTip1;
break;

@ -333,6 +333,7 @@ namespace v2rayN.Views
case nameof(ETransport.ws):
case nameof(ETransport.httpupgrade):
case nameof(ETransport.splithttp):
case nameof(ETransport.xhttp):
tipRequestHost.Text = ResUI.TransportRequestHostTip2;
tipPath.Text = ResUI.TransportPathTip1;
break;

Loading…
Cancel
Save