Browse Source

SplitHTTP is now XHTTP for xray

pull/6079/head
2dust 1 week ago
parent
commit
04efed2079
  1. 1
      v2rayN/ServiceLib/Enums/ETransport.cs
  2. 2
      v2rayN/ServiceLib/Global.cs
  3. 2
      v2rayN/ServiceLib/Handler/Fmt/BaseFmt.cs
  4. 19
      v2rayN/ServiceLib/Models/V2rayConfig.cs
  5. 4
      v2rayN/ServiceLib/Resx/ResUI.Designer.cs
  6. 4
      v2rayN/ServiceLib/Resx/ResUI.resx
  7. 4
      v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx
  8. 4
      v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx
  9. 2
      v2rayN/ServiceLib/Services/CoreConfig/CoreConfigSingboxService.cs
  10. 17
      v2rayN/ServiceLib/Services/CoreConfig/CoreConfigV2rayService.cs
  11. 2
      v2rayN/ServiceLib/Services/Statistics/StatisticsXrayService.cs
  12. 1
      v2rayN/v2rayN.Desktop/Views/AddServerWindow.axaml.cs
  13. 1
      v2rayN/v2rayN/Views/AddServerWindow.xaml.cs

1
v2rayN/ServiceLib/Enums/ETransport.cs

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

2
v2rayN/ServiceLib/Global.cs

@ -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" };

2
v2rayN/ServiceLib/Handler/Fmt/BaseFmt.cs

@ -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;

19
v2rayN/ServiceLib/Models/V2rayConfig.cs

@ -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

4
v2rayN/ServiceLib/Resx/ResUI.Designer.cs generated

@ -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 {

4
v2rayN/ServiceLib/Resx/ResUI.resx

@ -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>

4
v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx

@ -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>

4
v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx

@ -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>

2
v2rayN/ServiceLib/Services/CoreConfig/CoreConfigSingboxService.cs

@ -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;

17
v2rayN/ServiceLib/Services/CoreConfig/CoreConfigV2rayService.cs

@ -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

2
v2rayN/ServiceLib/Services/Statistics/StatisticsXrayService.cs

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

1
v2rayN/v2rayN.Desktop/Views/AddServerWindow.axaml.cs

@ -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;

1
v2rayN/v2rayN/Views/AddServerWindow.xaml.cs

@ -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