From fe2e219b7a7fc6b29abade33da0163b7ed487374 Mon Sep 17 00:00:00 2001 From: Aredelya Date: Fri, 4 Sep 2026 06:48:42 +0300 Subject: [PATCH] Expose the mux multiplexing settings in the Core settings UI (#10055) * Exposed the mux multiplexing settings in the core settings UI. Now it's possible to change the default concurrency value of 8 without editing config.json. * Adjust * Adjust --------- Co-authored-by: 2dust <31833384+2dust@users.noreply.github.com> --- v2rayN/ServiceLib/Resx/ResUI.Designer.cs | 36 +++++++++ v2rayN/ServiceLib/Resx/ResUI.resx | 12 +++ v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx | 3 + .../ViewModels/OptionSettingViewModel.cs | 9 +++ .../Views/OptionSettingWindow.axaml | 71 ++++++++++++++++- .../Views/OptionSettingWindow.axaml.cs | 4 + v2rayN/v2rayN/Views/OptionSettingWindow.xaml | 78 ++++++++++++++++++- .../v2rayN/Views/OptionSettingWindow.xaml.cs | 4 + 8 files changed, 215 insertions(+), 2 deletions(-) diff --git a/v2rayN/ServiceLib/Resx/ResUI.Designer.cs b/v2rayN/ServiceLib/Resx/ResUI.Designer.cs index 460a31e0..18476257 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.Designer.cs +++ b/v2rayN/ServiceLib/Resx/ResUI.Designer.cs @@ -4545,6 +4545,42 @@ namespace ServiceLib.Resx { } } + /// + /// 查找类似 Xray Mux setting 的本地化字符串。 + /// + public static string TbSettingsMux4Ray { + get { + return ResourceManager.GetString("TbSettingsMux4Ray", resourceCulture); + } + } + + /// + /// 查找类似 Xray Mux concurrency 的本地化字符串。 + /// + public static string TbSettingsMux4RayConcurrency { + get { + return ResourceManager.GetString("TbSettingsMux4RayConcurrency", resourceCulture); + } + } + + /// + /// 查找类似 Xray Mux XUDP concurrency 的本地化字符串。 + /// + public static string TbSettingsMux4RayXudpConcurrency { + get { + return ResourceManager.GetString("TbSettingsMux4RayXudpConcurrency", resourceCulture); + } + } + + /// + /// 查找类似 Xray Mux XUDP proxy UDP443 的本地化字符串。 + /// + public static string TbSettingsMux4RayXudpProxyUDP443 { + get { + return ResourceManager.GetString("TbSettingsMux4RayXudpProxyUDP443", resourceCulture); + } + } + /// /// 查找类似 sing-box Mux Protocol 的本地化字符串。 /// diff --git a/v2rayN/ServiceLib/Resx/ResUI.resx b/v2rayN/ServiceLib/Resx/ResUI.resx index b7f245dd..cabfec36 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.resx @@ -1023,6 +1023,15 @@ sing-box Mux Protocol + + Xray Mux concurrency + + + Xray Mux XUDP concurrency + + + Xray Mux XUDP proxy UDP443 + Process (Linux/Windows) @@ -1875,4 +1884,7 @@ The "Get Certificate" action may fail if a self-signed certificate is used or if DNS + + Xray Mux setting + \ No newline at end of file diff --git a/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx b/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx index d6154607..a2e94ea8 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx @@ -1876,4 +1876,7 @@ DNS + + Xray Mux 设置 + \ No newline at end of file diff --git a/v2rayN/ServiceLib/ViewModels/OptionSettingViewModel.cs b/v2rayN/ServiceLib/ViewModels/OptionSettingViewModel.cs index 9131fc4e..0837571c 100644 --- a/v2rayN/ServiceLib/ViewModels/OptionSettingViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/OptionSettingViewModel.cs @@ -22,6 +22,9 @@ public partial class OptionSettingViewModel : MyReactiveObject, ICloseable [Reactive] public partial string DefUserAgent { get; set; } [Reactive] public partial string SendThrough { get; set; } [Reactive] public partial string BindInterface { get; set; } + [Reactive] public partial int? Mux4RayConcurrency { get; set; } + [Reactive] public partial int? Mux4RayXudpConcurrency { get; set; } + [Reactive] public partial string Mux4RayXudpProxyUDP443 { get; set; } [Reactive] public partial string Mux4SboxProtocol { get; set; } [Reactive] public partial bool EnableCacheFile4Sbox { get; set; } [Reactive] public partial int? HyUpMbps { get; set; } @@ -152,6 +155,9 @@ public partial class OptionSettingViewModel : MyReactiveObject, ICloseable DefUserAgent = _config.CoreBasicItem.DefUserAgent; SendThrough = _config.CoreBasicItem.SendThrough ?? string.Empty; BindInterface = _config.CoreBasicItem.BindInterface ?? string.Empty; + Mux4RayConcurrency = _config.Mux4RayItem.Concurrency; + Mux4RayXudpConcurrency = _config.Mux4RayItem.XudpConcurrency; + Mux4RayXudpProxyUDP443 = _config.Mux4RayItem.XudpProxyUDP443 ?? string.Empty; Mux4SboxProtocol = _config.Mux4SboxItem.Protocol; EnableCacheFile4Sbox = _config.CoreBasicItem.EnableCacheFile4Sbox; HyUpMbps = _config.HysteriaItem.UpMbps; @@ -327,6 +333,9 @@ public partial class OptionSettingViewModel : MyReactiveObject, ICloseable _config.CoreBasicItem.DefUserAgent = DefUserAgent; _config.CoreBasicItem.SendThrough = SendThrough.TrimEx(); _config.CoreBasicItem.BindInterface = BindInterface.TrimEx(); + _config.Mux4RayItem.Concurrency = Mux4RayConcurrency > 0 ? Mux4RayConcurrency : null; + _config.Mux4RayItem.XudpConcurrency = Mux4RayXudpConcurrency > 0 ? Mux4RayXudpConcurrency : null; + _config.Mux4RayItem.XudpProxyUDP443 = Mux4RayXudpProxyUDP443.NullIfEmpty(); _config.Mux4SboxItem.Protocol = Mux4SboxProtocol; _config.CoreBasicItem.EnableCacheFile4Sbox = EnableCacheFile4Sbox; _config.HysteriaItem.UpMbps = HyUpMbps ?? 0; diff --git a/v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml b/v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml index 6ed09193..b509bfa2 100644 --- a/v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml +++ b/v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml @@ -40,7 +40,7 @@ + RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto"> + + + diff --git a/v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml.cs b/v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml.cs index 9945d63c..8f8e609d 100644 --- a/v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml.cs +++ b/v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml.cs @@ -30,6 +30,7 @@ public partial class OptionSettingWindow : WindowBase cmbdefFingerprint.ItemsSource = Global.Fingerprints; cmbdefUserAgent.ItemsSource = Global.UserAgent; cmbmux4SboxProtocol.ItemsSource = Global.SingboxMuxs; + cmbmux4RayXudpProxyUDP443.ItemsSource = new[] { "reject", "skip" }; cmbMtu.ItemsSource = Global.TunMtus; cmbStack.ItemsSource = Global.TunStacks; cmbIcmpRoutingPolicy.ItemsSource = Global.TunIcmpRoutingPolicies; @@ -80,6 +81,9 @@ public partial class OptionSettingWindow : WindowBase this.Bind(ViewModel, vm => vm.DefFingerprint, v => v.cmbdefFingerprint.SelectedValue).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.DefUserAgent, v => v.cmbdefUserAgent.SelectedValue).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.BindInterface, v => v.txtbindInterface.Text).DisposeWith(disposables); + this.Bind(ViewModel, vm => vm.Mux4RayConcurrency, v => v.txtmux4RayConcurrency.Text).DisposeWith(disposables); + this.Bind(ViewModel, vm => vm.Mux4RayXudpConcurrency, v => v.txtmux4RayXudpConcurrency.Text).DisposeWith(disposables); + this.Bind(ViewModel, vm => vm.Mux4RayXudpProxyUDP443, v => v.cmbmux4RayXudpProxyUDP443.SelectedValue).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.SendThrough, v => v.txtsendThrough.Text).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.Mux4SboxProtocol, v => v.cmbmux4SboxProtocol.SelectedValue).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.EnableCacheFile4Sbox, v => v.togenableCacheFile4Sbox.IsChecked).DisposeWith(disposables); diff --git a/v2rayN/v2rayN/Views/OptionSettingWindow.xaml b/v2rayN/v2rayN/Views/OptionSettingWindow.xaml index f9cafbc0..6a275dd1 100644 --- a/v2rayN/v2rayN/Views/OptionSettingWindow.xaml +++ b/v2rayN/v2rayN/Views/OptionSettingWindow.xaml @@ -74,6 +74,7 @@ + @@ -535,6 +536,82 @@ Style="{StaticResource ToolbarTextBlock}" Text="{x:Static resx:ResUI.TbSettingsSendThroughTip}" TextWrapping="Wrap" /> + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1365,7 +1442,6 @@ HorizontalAlignment="Left" Style="{StaticResource DefComboBox}" /> - vm.DefUserAgent, v => v.cmbdefUserAgent.Text).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.SendThrough, v => v.txtsendThrough.Text).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.BindInterface, v => v.txtbindInterface.Text).DisposeWith(disposables); + this.Bind(ViewModel, vm => vm.Mux4RayConcurrency, v => v.txtmux4RayConcurrency.Text).DisposeWith(disposables); + this.Bind(ViewModel, vm => vm.Mux4RayXudpConcurrency, v => v.txtmux4RayXudpConcurrency.Text).DisposeWith(disposables); + this.Bind(ViewModel, vm => vm.Mux4RayXudpProxyUDP443, v => v.cmbmux4RayXudpProxyUDP443.Text).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.Mux4SboxProtocol, v => v.cmbmux4SboxProtocol.Text).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.EnableCacheFile4Sbox, v => v.togenableCacheFile4Sbox.IsChecked).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.HyUpMbps, v => v.txtUpMbps.Text).DisposeWith(disposables);