From 2f35e7a99c61f6fa959d3c4665b54cb4b603966f Mon Sep 17 00:00:00 2001 From: DHR60 Date: Thu, 26 Feb 2026 07:07:24 +0000 Subject: [PATCH] Fix fragment (#8840) --- v2rayN/ServiceLib/Resx/ResUI.Designer.cs | 9 --------- v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx | 3 --- v2rayN/ServiceLib/Resx/ResUI.fr.resx | 3 --- v2rayN/ServiceLib/Resx/ResUI.hu.resx | 3 --- v2rayN/ServiceLib/Resx/ResUI.resx | 3 --- v2rayN/ServiceLib/Resx/ResUI.ru.resx | 3 --- v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx | 3 --- v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx | 3 --- .../CoreConfig/V2ray/V2rayOutboundService.cs | 13 +++++++------ .../v2rayN.Desktop/Views/OptionSettingWindow.axaml | 6 ------ v2rayN/v2rayN/Views/OptionSettingWindow.xaml | 7 ------- 11 files changed, 7 insertions(+), 49 deletions(-) diff --git a/v2rayN/ServiceLib/Resx/ResUI.Designer.cs b/v2rayN/ServiceLib/Resx/ResUI.Designer.cs index f5c2133b..8f798007 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.Designer.cs +++ b/v2rayN/ServiceLib/Resx/ResUI.Designer.cs @@ -3789,15 +3789,6 @@ namespace ServiceLib.Resx { } } - /// - /// 查找类似 which conflicts with the group previous proxy 的本地化字符串。 - /// - public static string TbSettingsEnableFragmentTips { - get { - return ResourceManager.GetString("TbSettingsEnableFragmentTips", resourceCulture); - } - } - /// /// 查找类似 Enable hardware acceleration (requires restart) 的本地化字符串。 /// diff --git a/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx b/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx index e7fad86c..9aba2fed 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx @@ -1110,9 +1110,6 @@ افزودن سرور [HTTP] - - which conflicts with the group previous proxy - فعال کردن فرگمنت diff --git a/v2rayN/ServiceLib/Resx/ResUI.fr.resx b/v2rayN/ServiceLib/Resx/ResUI.fr.resx index ec0d42bd..2deed9fb 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.fr.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.fr.resx @@ -1107,9 +1107,6 @@ Ajouter [HTTP] - - En conflit avec le proxy amont de groupe - Activer le fragmentation (Fragment) diff --git a/v2rayN/ServiceLib/Resx/ResUI.hu.resx b/v2rayN/ServiceLib/Resx/ResUI.hu.resx index aa3a383e..e69a0a54 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.hu.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.hu.resx @@ -1110,9 +1110,6 @@ HTTP konfiguráció hozzáadása - - 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 78c76096..cc304154 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.resx @@ -1110,9 +1110,6 @@ Add [HTTP] - - 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 b41314fd..6f093f72 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.ru.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.ru.resx @@ -1110,9 +1110,6 @@ Добавить сервер [HTTP] - - что конфликтует с предыдущим прокси группы - Включить фрагментацию (Fragment) diff --git a/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx b/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx index 77e55a71..c0f8665d 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx @@ -1107,9 +1107,6 @@ 添加 [HTTP] - - 和分组前置代理冲突 - 启用分片 (Fragment) diff --git a/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx b/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx index 818de86d..9002c3af 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx @@ -1107,9 +1107,6 @@ 新增 [HTTP] 節點 - - 和分組前置代理衝突 - 啟用分片(Fragment) diff --git a/v2rayN/ServiceLib/Services/CoreConfig/V2ray/V2rayOutboundService.cs b/v2rayN/ServiceLib/Services/CoreConfig/V2ray/V2rayOutboundService.cs index a6bb21ec..e9002db2 100644 --- a/v2rayN/ServiceLib/Services/CoreConfig/V2ray/V2rayOutboundService.cs +++ b/v2rayN/ServiceLib/Services/CoreConfig/V2ray/V2rayOutboundService.cs @@ -31,7 +31,7 @@ public partial class CoreConfigV2rayService var fragmentOutbound = new Outbounds4Ray { protocol = "freedom", - tag = $"frag-{Global.ProxyTag}", + tag = $"frag-{baseTagName}", settings = new() { fragment = new() @@ -44,16 +44,17 @@ public partial class CoreConfigV2rayService }; var actOutboundWithTlsList = proxyOutboundList.Where(n => n.streamSettings?.security.IsNullOrEmpty() == false - && (n.streamSettings?.sockopt?.dialerProxy?.IsNullOrEmpty() ?? true)); + && (n.streamSettings?.sockopt?.dialerProxy?.IsNullOrEmpty() ?? true)).ToList(); + if (actOutboundWithTlsList.Count > 0) + { + proxyOutboundList.Add(fragmentOutbound); + } foreach (var outbound in actOutboundWithTlsList) { - var fragmentOutboundClone = JsonUtils.DeepCopy(fragmentOutbound); - fragmentOutboundClone.tag = $"frag-{outbound.tag}"; outbound.streamSettings.sockopt = new() { - dialerProxy = fragmentOutboundClone.tag + dialerProxy = fragmentOutbound.tag }; - proxyOutboundList.Add(fragmentOutboundClone); } } return proxyOutboundList; diff --git a/v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml b/v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml index 6160cfad..cfcb48f0 100644 --- a/v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml +++ b/v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml @@ -325,12 +325,6 @@ Grid.Column="1" Margin="{StaticResource Margin4}" HorizontalAlignment="Left" /> - diff --git a/v2rayN/v2rayN/Views/OptionSettingWindow.xaml b/v2rayN/v2rayN/Views/OptionSettingWindow.xaml index ed82860d..8f0d24d4 100644 --- a/v2rayN/v2rayN/Views/OptionSettingWindow.xaml +++ b/v2rayN/v2rayN/Views/OptionSettingWindow.xaml @@ -391,13 +391,6 @@ Grid.Column="1" Margin="{StaticResource Margin8}" HorizontalAlignment="Left" /> -