From f8ae1b8c49bdefb0356e5a6c3299efc3a05786d8 Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Mon, 11 Mar 2024 08:34:07 +0800 Subject: [PATCH] Bug fix --- v2rayN/v2rayN/Handler/CoreConfigSingbox.cs | 12 ++++-------- v2rayN/v2rayN/Model/SingboxConfig.cs | 8 ++++---- v2rayN/v2rayN/Resx/ResUI.Designer.cs | 2 +- v2rayN/v2rayN/Resx/ResUI.resx | 2 +- 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/v2rayN/v2rayN/Handler/CoreConfigSingbox.cs b/v2rayN/v2rayN/Handler/CoreConfigSingbox.cs index f59a0204..2781cd69 100644 --- a/v2rayN/v2rayN/Handler/CoreConfigSingbox.cs +++ b/v2rayN/v2rayN/Handler/CoreConfigSingbox.cs @@ -426,11 +426,6 @@ namespace v2rayN.Handler transport.path = Utile.IsNullOrEmpty(node.path) ? null : node.path; } } - else - { - transport = null; - } - break; case nameof(ETransport.ws): @@ -458,11 +453,12 @@ namespace v2rayN.Handler break; default: - transport = null; break; } - - outbound.transport = transport; + if (transport.type != null) + { + outbound.transport = transport; + } } catch (Exception ex) { diff --git a/v2rayN/v2rayN/Model/SingboxConfig.cs b/v2rayN/v2rayN/Model/SingboxConfig.cs index a5911cc9..3b917832 100644 --- a/v2rayN/v2rayN/Model/SingboxConfig.cs +++ b/v2rayN/v2rayN/Model/SingboxConfig.cs @@ -158,14 +158,14 @@ public class Transport4Sbox { - public string type { get; set; } + public string? type { get; set; } public List? host { get; set; } public string? path { get; set; } public Headers4Sbox? headers { get; set; } - public string service_name { get; set; } - public string idle_timeout { get; set; } - public string ping_timeout { get; set; } + public string? service_name { get; set; } + public string? idle_timeout { get; set; } + public string? ping_timeout { get; set; } public bool? permit_without_stream { get; set; } } diff --git a/v2rayN/v2rayN/Resx/ResUI.Designer.cs b/v2rayN/v2rayN/Resx/ResUI.Designer.cs index a292a700..ce88c0c6 100644 --- a/v2rayN/v2rayN/Resx/ResUI.Designer.cs +++ b/v2rayN/v2rayN/Resx/ResUI.Designer.cs @@ -466,7 +466,7 @@ namespace v2rayN.Resx { } /// - /// 查找类似 Previous proxy remakrs 的本地化字符串。 + /// 查找类似 Previous proxy remarks 的本地化字符串。 /// public static string LvPrevProfile { get { diff --git a/v2rayN/v2rayN/Resx/ResUI.resx b/v2rayN/v2rayN/Resx/ResUI.resx index 9bdb72cd..ead59ee3 100644 --- a/v2rayN/v2rayN/Resx/ResUI.resx +++ b/v2rayN/v2rayN/Resx/ResUI.resx @@ -1151,7 +1151,7 @@ Congestion control - Previous proxy remakrs + Previous proxy remarks Next proxy remarks