Skip to content

Commit 522571f

Browse files
committed
1 parent 123c49c commit 522571f

File tree

12 files changed

+60
-19
lines changed

12 files changed

+60
-19
lines changed

v2rayN/v2rayN/Enums/ETransport.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ public enum ETransport
66
kcp,
77
ws,
88
httpupgrade,
9+
splithttp,
910
h2,
1011
http,
1112
quic,

v2rayN/v2rayN/Global.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ internal class Global
157157
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" };
158158
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" };
159159
public static readonly List<string> Flows = new() { "", "xtls-rprx-vision", "xtls-rprx-vision-udp443" };
160-
public static readonly List<string> Networks = new() { "tcp", "kcp", "ws", "httpupgrade", "h2", "quic", "grpc" };
160+
public static readonly List<string> Networks = new() { "tcp", "kcp", "ws", "httpupgrade", "splithttp", "h2", "quic", "grpc" };
161161
public static readonly List<string> KcpHeaderTypes = new() { "srtp", "utp", "wechat-video", "dtls", "wireguard" };
162162
public static readonly List<string> CoreTypes = new() { "v2fly", "SagerNet", "Xray", "sing_box" };
163163
public static readonly List<string> CoreTypes4VLESS = new() { "Xray", "sing_box" };

v2rayN/v2rayN/Handler/CoreConfig/CoreConfigSingbox.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public int GenerateClientConfigContent(ProfileItem node, out SingboxConfig? sing
2626
msg = ResUI.CheckServerSettings;
2727
return -1;
2828
}
29-
if (node.GetNetwork() == nameof(ETransport.kcp))
29+
if (node.GetNetwork() is nameof(ETransport.kcp) or nameof(ETransport.splithttp))
3030
{
3131
msg = ResUI.Incorrectconfiguration + $" - {node.GetNetwork()}";
3232
return -1;

v2rayN/v2rayN/Handler/CoreConfig/CoreConfigV2ray.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,7 @@ private int GenBoundStreamSettings(ProfileItem node, StreamSettings4Ray streamSe
565565
publicKey = node.publicKey,
566566
shortId = node.shortId,
567567
spiderX = node.spiderX,
568+
show = false,
568569
};
569570

570571
streamSettings.realitySettings = realitySettings;
@@ -630,6 +631,25 @@ private int GenBoundStreamSettings(ProfileItem node, StreamSettings4Ray streamSe
630631
}
631632
streamSettings.httpupgradeSettings = httpupgradeSettings;
632633

634+
break;
635+
//splithttp
636+
case nameof(ETransport.splithttp):
637+
SplithttpSettings4Ray splithttpSettings = new()
638+
{
639+
maxUploadSize = 1000000,
640+
maxConcurrentUploads = 10
641+
};
642+
643+
if (!Utils.IsNullOrEmpty(node.path))
644+
{
645+
splithttpSettings.path = node.path;
646+
}
647+
if (!Utils.IsNullOrEmpty(host))
648+
{
649+
splithttpSettings.host = host;
650+
}
651+
streamSettings.splithttpSettings = splithttpSettings;
652+
633653
break;
634654
//h2
635655
case nameof(ETransport.h2):

v2rayN/v2rayN/Handler/Fmt/BaseFmt.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ protected static int GetStdTransport(ProfileItem item, string? securityDef, ref
8181

8282
case nameof(ETransport.ws):
8383
case nameof(ETransport.httpupgrade):
84+
case nameof(ETransport.splithttp):
8485
if (!Utils.IsNullOrEmpty(item.requestHost))
8586
{
8687
dicQuery.Add("host", Utils.UrlEncode(item.requestHost));
@@ -152,6 +153,7 @@ protected static int ResolveStdTransport(NameValueCollection query, ref ProfileI
152153

153154
case nameof(ETransport.ws):
154155
case nameof(ETransport.httpupgrade):
156+
case nameof(ETransport.splithttp):
155157
item.requestHost = Utils.UrlDecode(query["host"] ?? "");
156158
item.path = Utils.UrlDecode(query["path"] ?? "/");
157159
break;

v2rayN/v2rayN/Handler/Fmt/VmessFmt.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ internal class VmessFmt : BaseFmt
156156

157157
case nameof(ETransport.ws):
158158
case nameof(ETransport.httpupgrade):
159+
case nameof(ETransport.splithttp):
159160
string p1 = query["path"] ?? "/";
160161
string h1 = query["host"] ?? "";
161162
item.requestHost = Utils.UrlDecode(h1);

v2rayN/v2rayN/Models/V2rayConfig.cs

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -421,47 +421,52 @@ public class StreamSettings4Ray
421421
/// <summary>
422422
///
423423
/// </summary>
424-
public TlsSettings4Ray tlsSettings { get; set; }
424+
public TlsSettings4Ray? tlsSettings { get; set; }
425425

426426
/// <summary>
427427
/// Tcp传输额外设置
428428
/// </summary>
429-
public TcpSettings4Ray tcpSettings { get; set; }
429+
public TcpSettings4Ray? tcpSettings { get; set; }
430430

431431
/// <summary>
432432
/// Kcp传输额外设置
433433
/// </summary>
434-
public KcpSettings4Ray kcpSettings { get; set; }
434+
public KcpSettings4Ray? kcpSettings { get; set; }
435435

436436
/// <summary>
437437
/// ws传输额外设置
438438
/// </summary>
439-
public WsSettings4Ray wsSettings { get; set; }
439+
public WsSettings4Ray? wsSettings { get; set; }
440440

441441
/// <summary>
442442
///
443443
/// </summary>
444444
public HttpupgradeSettings4Ray? httpupgradeSettings { get; set; }
445445

446+
/// <summary>
447+
///
448+
/// </summary>
449+
public SplithttpSettings4Ray? splithttpSettings { get; set; }
450+
446451
/// <summary>
447452
/// h2传输额外设置
448453
/// </summary>
449-
public HttpSettings4Ray httpSettings { get; set; }
454+
public HttpSettings4Ray? httpSettings { get; set; }
450455

451456
/// <summary>
452457
/// QUIC
453458
/// </summary>
454-
public QuicSettings4Ray quicSettings { get; set; }
459+
public QuicSettings4Ray? quicSettings { get; set; }
455460

456461
/// <summary>
457462
/// VLESS only
458463
/// </summary>
459-
public TlsSettings4Ray realitySettings { get; set; }
464+
public TlsSettings4Ray? realitySettings { get; set; }
460465

461466
/// <summary>
462467
/// grpc
463468
/// </summary>
464-
public GrpcSettings4Ray grpcSettings { get; set; }
469+
public GrpcSettings4Ray? grpcSettings { get; set; }
465470

466471
/// <summary>
467472
/// sockopt
@@ -488,7 +493,7 @@ public class TlsSettings4Ray
488493

489494
public string? fingerprint { get; set; }
490495

491-
public bool? show { get; set; } = false;
496+
public bool? show { get; set; }
492497
public string? publicKey { get; set; }
493498
public string? shortId { get; set; }
494499
public string? spiderX { get; set; }
@@ -608,6 +613,17 @@ public class HttpupgradeSettings4Ray
608613
public string? host { get; set; }
609614
}
610615

616+
public class SplithttpSettings4Ray
617+
{
618+
public string? path { get; set; }
619+
620+
public string? host { get; set; }
621+
622+
public int? maxUploadSize { get; set; }
623+
624+
public int? maxConcurrentUploads { get; set; }
625+
}
626+
611627
public class HttpSettings4Ray
612628
{
613629
/// <summary>

v2rayN/v2rayN/Resx/ResUI.Designer.cs

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

v2rayN/v2rayN/Resx/ResUI.resx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@
359359
<value>Please fill in the correct custom DNS</value>
360360
</data>
361361
<data name="TransportPathTip1" xml:space="preserve">
362-
<value>*ws/httpupgrade path</value>
362+
<value>*ws/httpupgrade/splithttp path</value>
363363
</data>
364364
<data name="TransportPathTip2" xml:space="preserve">
365365
<value>*h2 path</value>
@@ -374,7 +374,7 @@
374374
<value>*http host Separated by commas (,)</value>
375375
</data>
376376
<data name="TransportRequestHostTip2" xml:space="preserve">
377-
<value>*ws/httpupgrade host</value>
377+
<value>*ws/httpupgrade/splithttp host</value>
378378
</data>
379379
<data name="TransportRequestHostTip3" xml:space="preserve">
380380
<value>*h2 host Separated by commas (,)</value>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@
359359
<value>请填写正确的自定义DNS</value>
360360
</data>
361361
<data name="TransportPathTip1" xml:space="preserve">
362-
<value>*ws/httpupgrade path</value>
362+
<value>*ws/httpupgrade/splithttp path</value>
363363
</data>
364364
<data name="TransportPathTip2" xml:space="preserve">
365365
<value>*h2 path</value>
@@ -374,7 +374,7 @@
374374
<value>*http host中间逗号(,)分隔</value>
375375
</data>
376376
<data name="TransportRequestHostTip2" xml:space="preserve">
377-
<value>*ws/httpupgrade host</value>
377+
<value>*ws/httpupgrade/splithttp host</value>
378378
</data>
379379
<data name="TransportRequestHostTip3" xml:space="preserve">
380380
<value>*h2 host中间逗号(,)分隔</value>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@
358358
<value>請填寫正確的自訂DNS</value>
359359
</data>
360360
<data name="TransportPathTip1" xml:space="preserve">
361-
<value>*ws/httpupgrade path</value>
361+
<value>*ws/httpupgrade/splithttp path</value>
362362
</data>
363363
<data name="TransportPathTip2" xml:space="preserve">
364364
<value>*h2 path</value>
@@ -373,7 +373,7 @@
373373
<value>*http host中間逗號(,)分隔</value>
374374
</data>
375375
<data name="TransportRequestHostTip2" xml:space="preserve">
376-
<value>*ws/httpupgrade host</value>
376+
<value>*ws/httpupgrade/splithttp host</value>
377377
</data>
378378
<data name="TransportRequestHostTip3" xml:space="preserve">
379379
<value>*h2 host中間逗號(,)分隔</value>

v2rayN/v2rayN/Views/AddServerWindow.xaml.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,7 @@ private void SetTips()
333333

334334
case nameof(ETransport.ws):
335335
case nameof(ETransport.httpupgrade):
336+
case nameof(ETransport.splithttp):
336337
tipRequestHost.Text = ResUI.TransportRequestHostTip2;
337338
tipPath.Text = ResUI.TransportPathTip1;
338339
break;

0 commit comments

Comments
 (0)