diff --git a/v2rayN/ProtosLib/ProtosLib.csproj b/v2rayN/ProtosLib/ProtosLib.csproj index 66a9c184..492a4837 100644 --- a/v2rayN/ProtosLib/ProtosLib.csproj +++ b/v2rayN/ProtosLib/ProtosLib.csproj @@ -9,7 +9,7 @@ - + all diff --git a/v2rayN/v2rayN/Handler/ConfigHandler.cs b/v2rayN/v2rayN/Handler/ConfigHandler.cs index 7473ffa5..c9770c5a 100644 --- a/v2rayN/v2rayN/Handler/ConfigHandler.cs +++ b/v2rayN/v2rayN/Handler/ConfigHandler.cs @@ -140,7 +140,6 @@ namespace v2rayN.Handler config.guiItem = new() { enableStatistics = false, - statisticsFreshRate = 1, }; } if (config.uiItem == null) @@ -185,11 +184,6 @@ namespace v2rayN.Handler config.speedTestItem.speedPingTestUrl = Global.SpeedPingTestUrl; } - if (config.guiItem.statisticsFreshRate is > 100 or < 1) - { - config.guiItem.statisticsFreshRate = 1; - } - if (config.mux4Sbox == null) { config.mux4Sbox = new() @@ -331,7 +325,6 @@ namespace v2rayN.Handler config.guiItem = new() { enableStatistics = configOld.enableStatistics, - statisticsFreshRate = configOld.statisticsFreshRate, keepOlderDedupl = configOld.keepOlderDedupl, ignoreGeoUpdateCore = configOld.ignoreGeoUpdateCore, autoUpdateInterval = configOld.autoUpdateInterval, diff --git a/v2rayN/v2rayN/Handler/CoreConfigSingbox.cs b/v2rayN/v2rayN/Handler/CoreConfigSingbox.cs index 638655af..7d64b7b8 100644 --- a/v2rayN/v2rayN/Handler/CoreConfigSingbox.cs +++ b/v2rayN/v2rayN/Handler/CoreConfigSingbox.cs @@ -107,29 +107,18 @@ namespace v2rayN.Handler { try { - if (_config.tunModeItem.enableTun) + singboxConfig.inbounds.Clear(); + + if (!_config.tunModeItem.enableTun || (_config.tunModeItem.enableTun && _config.tunModeItem.enableExInbound)) { - singboxConfig.inbounds.Clear(); - - if (_config.tunModeItem.mtu <= 0) + var inbound = new Inbound4Sbox() { - _config.tunModeItem.mtu = Convert.ToInt32(Global.TunMtus[0]); - } - if (Utils.IsNullOrEmpty(_config.tunModeItem.stack)) - { - _config.tunModeItem.stack = Global.TunStacks[0]; - } + type = Global.InboundSocks, + tag = Global.InboundSocks, + listen = Global.Loopback, + }; + singboxConfig.inbounds.Add(inbound); - var tunInbound = Utils.FromJson(Utils.GetEmbedText(Global.TunSingboxInboundFileName)); - tunInbound.mtu = _config.tunModeItem.mtu; - tunInbound.strict_route = _config.tunModeItem.strictRoute; - tunInbound.stack = _config.tunModeItem.stack; - - singboxConfig.inbounds.Add(tunInbound); - } - else - { - var inbound = singboxConfig.inbounds[0]; inbound.listen_port = LazyConfig.Instance.GetLocalPort(Global.InboundSocks); inbound.sniff = _config.inbound[0].sniffingEnabled; inbound.sniff_override_destination = _config.inbound[0].routeOnly ? false : _config.inbound[0].sniffingEnabled; @@ -174,6 +163,25 @@ namespace v2rayN.Handler } } } + + if (_config.tunModeItem.enableTun) + { + if (_config.tunModeItem.mtu <= 0) + { + _config.tunModeItem.mtu = Convert.ToInt32(Global.TunMtus[0]); + } + if (Utils.IsNullOrEmpty(_config.tunModeItem.stack)) + { + _config.tunModeItem.stack = Global.TunStacks[0]; + } + + var tunInbound = Utils.FromJson(Utils.GetEmbedText(Global.TunSingboxInboundFileName)); + tunInbound.mtu = _config.tunModeItem.mtu; + tunInbound.strict_route = _config.tunModeItem.strictRoute; + tunInbound.stack = _config.tunModeItem.stack; + + singboxConfig.inbounds.Add(tunInbound); + } } catch (Exception ex) { @@ -255,7 +263,6 @@ namespace v2rayN.Handler outbound.type = Global.vlessProtocolLite; outbound.uuid = node.id; - outbound.flow = node.flow; outbound.packet_encoding = "xudp"; @@ -263,6 +270,10 @@ namespace v2rayN.Handler { outboundMux(node, outbound); } + else + { + outbound.flow = node.flow; + } } else if (node.configType == EConfigType.Trojan) { diff --git a/v2rayN/v2rayN/Handler/CoreConfigV2ray.cs b/v2rayN/v2rayN/Handler/CoreConfigV2ray.cs index b4ef45f8..87253e54 100644 --- a/v2rayN/v2rayN/Handler/CoreConfigV2ray.cs +++ b/v2rayN/v2rayN/Handler/CoreConfigV2ray.cs @@ -423,7 +423,6 @@ namespace v2rayN.Handler usersItem = vnextItem.users[0]; } usersItem.id = node.id; - usersItem.flow = string.Empty; usersItem.email = Global.userEMail; usersItem.encryption = node.security; @@ -462,7 +461,6 @@ namespace v2rayN.Handler serversItem.address = node.address; serversItem.port = node.port; serversItem.password = node.id; - serversItem.flow = string.Empty; serversItem.ota = false; serversItem.level = 1; diff --git a/v2rayN/v2rayN/Handler/StatisticsV2ray.cs b/v2rayN/v2rayN/Handler/StatisticsV2ray.cs index f2a74af3..ef70f02a 100644 --- a/v2rayN/v2rayN/Handler/StatisticsV2ray.cs +++ b/v2rayN/v2rayN/Handler/StatisticsV2ray.cs @@ -61,8 +61,7 @@ namespace v2rayN.Handler _updateFunc(server); } } - var sleep = _config.guiItem.statisticsFreshRate < 1 ? 1 : _config.guiItem.statisticsFreshRate; - await Task.Delay(1000 * sleep); + await Task.Delay(1000); await _channel.ConnectAsync(); } catch diff --git a/v2rayN/v2rayN/Mode/ConfigItems.cs b/v2rayN/v2rayN/Mode/ConfigItems.cs index 25b91608..5f807744 100644 --- a/v2rayN/v2rayN/Mode/ConfigItems.cs +++ b/v2rayN/v2rayN/Mode/ConfigItems.cs @@ -88,8 +88,6 @@ namespace v2rayN.Mode public bool enableStatistics { get; set; } - public int statisticsFreshRate { get; set; } - public bool keepOlderDedupl { get; set; } public bool ignoreGeoUpdateCore { get; set; } = true; @@ -165,6 +163,7 @@ namespace v2rayN.Mode public bool strictRoute { get; set; } public string stack { get; set; } public int mtu { get; set; } + public bool enableExInbound { get; set; } } [Serializable] diff --git a/v2rayN/v2rayN/Mode/V2rayConfig.cs b/v2rayN/v2rayN/Mode/V2rayConfig.cs index b20f526d..14c5dee0 100644 --- a/v2rayN/v2rayN/Mode/V2rayConfig.cs +++ b/v2rayN/v2rayN/Mode/V2rayConfig.cs @@ -185,7 +185,7 @@ namespace v2rayN.Mode /// /// VLESS /// - public string flow { get; set; } + public string? flow { get; set; } } public class Sniffing4Ray diff --git a/v2rayN/v2rayN/Resx/ResUI.Designer.cs b/v2rayN/v2rayN/Resx/ResUI.Designer.cs index 7c86b46b..e730105c 100644 --- a/v2rayN/v2rayN/Resx/ResUI.Designer.cs +++ b/v2rayN/v2rayN/Resx/ResUI.Designer.cs @@ -2761,15 +2761,6 @@ namespace v2rayN.Resx { } } - /// - /// 查找类似 Statistics freshrate (second) 的本地化字符串。 - /// - public static string TbSettingsStatisticsFreshRate { - get { - return ResourceManager.GetString("TbSettingsStatisticsFreshRate", resourceCulture); - } - } - /// /// 查找类似 Subscription conversion Url 的本地化字符串。 /// diff --git a/v2rayN/v2rayN/Resx/ResUI.fa-Ir.resx b/v2rayN/v2rayN/Resx/ResUI.fa-Ir.resx index 1d80cc52..f743541b 100644 --- a/v2rayN/v2rayN/Resx/ResUI.fa-Ir.resx +++ b/v2rayN/v2rayN/Resx/ResUI.fa-Ir.resx @@ -793,9 +793,6 @@ فعال کردن آمار (نیاز به راه اندازی مجدد) - - نرخ تازه سازی آمار (ثانیه) - Subscription conversion Url diff --git a/v2rayN/v2rayN/Resx/ResUI.resx b/v2rayN/v2rayN/Resx/ResUI.resx index 6851b29d..d3721f1a 100644 --- a/v2rayN/v2rayN/Resx/ResUI.resx +++ b/v2rayN/v2rayN/Resx/ResUI.resx @@ -796,9 +796,6 @@ Enable Statistics (Require restart) - - Statistics freshrate (second) - Subscription conversion Url diff --git a/v2rayN/v2rayN/Resx/ResUI.ru.resx b/v2rayN/v2rayN/Resx/ResUI.ru.resx index bb63c226..7034d93f 100644 --- a/v2rayN/v2rayN/Resx/ResUI.ru.resx +++ b/v2rayN/v2rayN/Resx/ResUI.ru.resx @@ -796,9 +796,6 @@ Включить статистику (требуется перезагрузка) - - Частота обновления статистики в секундах - URL-адрес конверсии подписки diff --git a/v2rayN/v2rayN/Resx/ResUI.zh-Hans.resx b/v2rayN/v2rayN/Resx/ResUI.zh-Hans.resx index caa368ef..71a046af 100644 --- a/v2rayN/v2rayN/Resx/ResUI.zh-Hans.resx +++ b/v2rayN/v2rayN/Resx/ResUI.zh-Hans.resx @@ -796,9 +796,6 @@ 启用统计(实时网速显示,需重启) - - 统计刷新频率(单位秒) - 订阅转换网址(可选) diff --git a/v2rayN/v2rayN/Sample/tun_singbox_inbound b/v2rayN/v2rayN/Sample/tun_singbox_inbound index 637d24f4..b4856dd3 100644 --- a/v2rayN/v2rayN/Sample/tun_singbox_inbound +++ b/v2rayN/v2rayN/Sample/tun_singbox_inbound @@ -1,11 +1,12 @@ { - "type":"tun", - "tag":"tun-in", - "interface_name":"singbox_tun", - "inet4_address":"172.19.0.1/30", - "mtu":9000, - "auto_route":true, - "strict_route":false, - "stack":"system", - "sniff":true + "type": "tun", + "tag": "tun-in", + "interface_name": "singbox_tun", + "inet4_address": "172.19.0.1/30", + "inet6_address": "fdfe:dcba:9876::1/126", + "mtu": 9000, + "auto_route": true, + "strict_route": false, + "stack": "system", + "sniff": true } \ No newline at end of file diff --git a/v2rayN/v2rayN/ViewModels/MainWindowViewModel.cs b/v2rayN/v2rayN/ViewModels/MainWindowViewModel.cs index 030d1a5e..164644e7 100644 --- a/v2rayN/v2rayN/ViewModels/MainWindowViewModel.cs +++ b/v2rayN/v2rayN/ViewModels/MainWindowViewModel.cs @@ -170,8 +170,8 @@ namespace v2rayN.ViewModels [Reactive] public ImageSource AppIcon { get; set; } - [Reactive] - public bool BlShowTrayTip { get; set; } + //[Reactive] + //public bool BlShowTrayTip { get; set; } #endregion Menu @@ -213,8 +213,8 @@ namespace v2rayN.ViewModels [Reactive] public string RunningServerDisplay { get; set; } - [Reactive] - public string RunningServerToolTipText { get; set; } + //[Reactive] + //public string RunningServerToolTipText { get; set; } [Reactive] public string RunningInfoDisplay { get; set; } @@ -944,12 +944,12 @@ namespace v2rayN.ViewModels { var runningSummary = running.GetSummary(); RunningServerDisplay = $"{ResUI.menuServers}:{runningSummary}"; - RunningServerToolTipText = runningSummary; + //RunningServerToolTipText = runningSummary; } else { - RunningServerDisplay = - RunningServerToolTipText = ResUI.CheckServerSettings; + RunningServerDisplay = ResUI.CheckServerSettings; + //RunningServerToolTipText = ResUI.CheckServerSettings; } })); } @@ -1814,7 +1814,7 @@ namespace v2rayN.ViewModels } CurrentFontSize = _config.uiItem.currentFontSize; CurrentLanguage = _config.uiItem.currentLanguage; - BlShowTrayTip = _config.uiItem.showTrayTip; + //BlShowTrayTip = _config.uiItem.showTrayTip; this.WhenAnyValue( x => x.ColorModeDark, diff --git a/v2rayN/v2rayN/ViewModels/OptionSettingViewModel.cs b/v2rayN/v2rayN/ViewModels/OptionSettingViewModel.cs index b1d9e803..e64d3aa2 100644 --- a/v2rayN/v2rayN/ViewModels/OptionSettingViewModel.cs +++ b/v2rayN/v2rayN/ViewModels/OptionSettingViewModel.cs @@ -51,7 +51,6 @@ namespace v2rayN.ViewModels [Reactive] public bool AutoRun { get; set; } [Reactive] public bool EnableStatistics { get; set; } - [Reactive] public int StatisticsFreshRate { get; set; } [Reactive] public bool KeepOlderDedupl { get; set; } [Reactive] public bool IgnoreGeoUpdateCore { get; set; } [Reactive] public bool EnableAutoAdjustMainLvColWidth { get; set; } @@ -141,7 +140,6 @@ namespace v2rayN.ViewModels AutoRun = _config.guiItem.autoRun; EnableStatistics = _config.guiItem.enableStatistics; - StatisticsFreshRate = _config.guiItem.statisticsFreshRate; KeepOlderDedupl = _config.guiItem.keepOlderDedupl; IgnoreGeoUpdateCore = _config.guiItem.ignoreGeoUpdateCore; EnableAutoAdjustMainLvColWidth = _config.uiItem.enableAutoAdjustMainLvColWidth; @@ -291,11 +289,6 @@ namespace v2rayN.ViewModels Utils.SetAutoRun(AutoRun); _config.guiItem.autoRun = AutoRun; _config.guiItem.enableStatistics = EnableStatistics; - _config.guiItem.statisticsFreshRate = StatisticsFreshRate; - if (_config.guiItem.statisticsFreshRate > 100 || _config.guiItem.statisticsFreshRate < 1) - { - _config.guiItem.statisticsFreshRate = 1; - } _config.guiItem.keepOlderDedupl = KeepOlderDedupl; _config.guiItem.ignoreGeoUpdateCore = IgnoreGeoUpdateCore; _config.uiItem.enableAutoAdjustMainLvColWidth = EnableAutoAdjustMainLvColWidth; diff --git a/v2rayN/v2rayN/Views/MainWindow.xaml b/v2rayN/v2rayN/Views/MainWindow.xaml index 80ab2103..3375f400 100644 --- a/v2rayN/v2rayN/Views/MainWindow.xaml +++ b/v2rayN/v2rayN/Views/MainWindow.xaml @@ -301,7 +301,7 @@ - + @@ -323,13 +323,13 @@ Margin="8" IsEnabled="{Binding ElementName=followSystemTheme, Path=IsChecked, Converter={StaticResource InverseBooleanConverter}}" /> - - + - - - - - diff --git a/v2rayN/v2rayN/Views/MainWindow.xaml.cs b/v2rayN/v2rayN/Views/MainWindow.xaml.cs index 1396a9ea..9fe2ef47 100644 --- a/v2rayN/v2rayN/Views/MainWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/MainWindow.xaml.cs @@ -165,10 +165,10 @@ namespace v2rayN.Views this.BindCommand(ViewModel, vm => vm.SubUpdateViaProxyCmd, v => v.menuSubUpdateViaProxy2).DisposeWith(disposables); this.OneWayBind(ViewModel, vm => vm.NotifyIcon, v => v.tbNotify.Icon).DisposeWith(disposables); - this.OneWayBind(ViewModel, vm => vm.RunningServerToolTipText, v => v.tbNotify.ToolTipText).DisposeWith(disposables); + //this.OneWayBind(ViewModel, vm => vm.RunningServerToolTipText, v => v.tbNotify.ToolTipText).DisposeWith(disposables); this.OneWayBind(ViewModel, vm => vm.NotifyLeftClickCmd, v => v.tbNotify.LeftClickCommand).DisposeWith(disposables); this.OneWayBind(ViewModel, vm => vm.AppIcon, v => v.Icon).DisposeWith(disposables); - this.OneWayBind(ViewModel, vm => vm.BlShowTrayTip, v => v.borTrayToolTip.Visibility).DisposeWith(disposables); + //this.OneWayBind(ViewModel, vm => vm.BlShowTrayTip, v => v.borTrayToolTip.Visibility).DisposeWith(disposables); //status bar this.OneWayBind(ViewModel, vm => vm.InboundDisplay, v => v.txtInboundDisplay.Text).DisposeWith(disposables); diff --git a/v2rayN/v2rayN/Views/OptionSettingWindow.xaml b/v2rayN/v2rayN/Views/OptionSettingWindow.xaml index ac4c5272..c2683b15 100644 --- a/v2rayN/v2rayN/Views/OptionSettingWindow.xaml +++ b/v2rayN/v2rayN/Views/OptionSettingWindow.xaml @@ -1,12 +1,12 @@  - - - { cmbMtu.Items.Add(it); @@ -150,7 +146,6 @@ namespace v2rayN.Views this.Bind(ViewModel, vm => vm.AutoRun, v => v.togAutoRun.IsChecked).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.EnableStatistics, v => v.togEnableStatistics.IsChecked).DisposeWith(disposables); - this.Bind(ViewModel, vm => vm.StatisticsFreshRate, v => v.cmbStatisticsFreshRate.Text).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.KeepOlderDedupl, v => v.togKeepOlderDedupl.IsChecked).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.IgnoreGeoUpdateCore, v => v.togIgnoreGeoUpdateCore.IsChecked).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.EnableAutoAdjustMainLvColWidth, v => v.togEnableAutoAdjustMainLvColWidth.IsChecked).DisposeWith(disposables); diff --git a/v2rayN/v2rayN/v2rayN.csproj b/v2rayN/v2rayN/v2rayN.csproj index 996d458f..8b213de2 100644 --- a/v2rayN/v2rayN/v2rayN.csproj +++ b/v2rayN/v2rayN/v2rayN.csproj @@ -10,11 +10,11 @@ enable v2rayN.ico Copyright © 2017-2023 (GPLv3) - 6.25 + 6.26 - + @@ -25,7 +25,7 @@ - +