From 925cf16c504dffc2b99b96e1f506fae587d3e472 Mon Sep 17 00:00:00 2001 From: DHR60 Date: Sun, 10 Aug 2025 13:39:51 +0800 Subject: [PATCH] Adds sing-box fragment support (#7729) --- v2rayN/ServiceLib/Models/SingboxConfig.cs | 3 +++ v2rayN/ServiceLib/Resx/ResUI.Designer.cs | 2 +- v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx | 2 +- v2rayN/ServiceLib/Resx/ResUI.hu.resx | 2 +- v2rayN/ServiceLib/Resx/ResUI.resx | 2 +- v2rayN/ServiceLib/Resx/ResUI.ru.resx | 2 +- v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx | 2 +- v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx | 2 +- .../ServiceLib/Services/CoreConfig/CoreConfigSingboxService.cs | 1 + 9 files changed, 11 insertions(+), 7 deletions(-) diff --git a/v2rayN/ServiceLib/Models/SingboxConfig.cs b/v2rayN/ServiceLib/Models/SingboxConfig.cs index cbaf77e6..30478174 100644 --- a/v2rayN/ServiceLib/Models/SingboxConfig.cs +++ b/v2rayN/ServiceLib/Models/SingboxConfig.cs @@ -179,6 +179,9 @@ public class Tls4Sbox public List? alpn { get; set; } public Utls4Sbox? utls { get; set; } public Reality4Sbox? reality { get; set; } + public bool? fragment { get; set; } + public string? fragment_fallback_delay { get; set; } + public bool? record_fragment { get; set; } } public class Multiplex4Sbox diff --git a/v2rayN/ServiceLib/Resx/ResUI.Designer.cs b/v2rayN/ServiceLib/Resx/ResUI.Designer.cs index 31405d61..6a021a2b 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.Designer.cs +++ b/v2rayN/ServiceLib/Resx/ResUI.Designer.cs @@ -3238,7 +3238,7 @@ namespace ServiceLib.Resx { } /// - /// 查找类似 Use Xray and enable non-Tun mode, which conflicts with the group previous proxy 的本地化字符串。 + /// 查找类似 which conflicts with the group previous proxy 的本地化字符串。 /// public static string TbSettingsEnableFragmentTips { get { diff --git a/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx b/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx index 24625798..25a3c80e 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx @@ -1105,7 +1105,7 @@ افزودن سرور [HTTP] - از Xray استفاده کنید و حالت non-Tun را فعال کنید، که با پراکسی قبلی گروه در تضاد است + which conflicts with the group previous proxy فعال کردن فرگمنت diff --git a/v2rayN/ServiceLib/Resx/ResUI.hu.resx b/v2rayN/ServiceLib/Resx/ResUI.hu.resx index 14df7b0e..20d0ab8e 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.hu.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.hu.resx @@ -1105,7 +1105,7 @@ HTTP konfiguráció hozzáadása - Használja az Xray-t és engedélyezze a nem Tun módot, ami ütközik a csoport előző proxyjával + which conflicts with the group previous proxy Fragment engedélyezése diff --git a/v2rayN/ServiceLib/Resx/ResUI.resx b/v2rayN/ServiceLib/Resx/ResUI.resx index e44f9098..a6009434 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.resx @@ -1105,7 +1105,7 @@ Add [HTTP] Configuration - Use Xray and enable non-Tun mode, which conflicts with the group previous proxy + which conflicts with the group previous proxy Enable fragment diff --git a/v2rayN/ServiceLib/Resx/ResUI.ru.resx b/v2rayN/ServiceLib/Resx/ResUI.ru.resx index c8c2894a..6207b163 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.ru.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.ru.resx @@ -1105,7 +1105,7 @@ Добавить сервер [HTTP] - Используйте Xray и отключите режим TUN, так как он конфликтует с предыдущим прокси-сервером группы + which conflicts with the group previous proxy Включить фрагментацию (Fragment) diff --git a/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx b/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx index f9c5a02b..72c42604 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx @@ -1102,7 +1102,7 @@ 添加 [HTTP] 配置文件 - 使用 Xray 且非 Tun 模式启用,和分组前置代理冲突 + 和分组前置代理冲突 启用分片 (Fragment) diff --git a/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx b/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx index 429e4637..84c8f929 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx @@ -1102,7 +1102,7 @@ 新增 [HTTP] 設定檔 - 使用 Xray 且非 Tun 模式啟用,和分組前置代理衝突 + 和分組前置代理衝突 啟用分片(Fragment) diff --git a/v2rayN/ServiceLib/Services/CoreConfig/CoreConfigSingboxService.cs b/v2rayN/ServiceLib/Services/CoreConfig/CoreConfigSingboxService.cs index 6ced20f0..b26f6336 100644 --- a/v2rayN/ServiceLib/Services/CoreConfig/CoreConfigSingboxService.cs +++ b/v2rayN/ServiceLib/Services/CoreConfig/CoreConfigSingboxService.cs @@ -890,6 +890,7 @@ public class CoreConfigSingboxService var tls = new Tls4Sbox() { enabled = true, + record_fragment = _config.CoreBasicItem.EnableFragment, server_name = server_name, insecure = Utils.ToBool(node.AllowInsecure.IsNullOrEmpty() ? _config.CoreBasicItem.DefAllowInsecure.ToString().ToLower() : node.AllowInsecure), alpn = node.GetAlpn(),