From 37a5b7f3b4def925638fe379e0daec1cbfbdb946 Mon Sep 17 00:00:00 2001 From: DHR60 Date: Mon, 28 Jul 2025 22:53:05 +0800 Subject: [PATCH] Fixes NaiveProxy --- v2rayN/ServiceLib/Handler/ConfigHandler.cs | 4 ++++ .../Services/CoreConfig/Minimal/CoreConfigNaiveService.cs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/v2rayN/ServiceLib/Handler/ConfigHandler.cs b/v2rayN/ServiceLib/Handler/ConfigHandler.cs index ade49c61..ab19578c 100644 --- a/v2rayN/ServiceLib/Handler/ConfigHandler.cs +++ b/v2rayN/ServiceLib/Handler/ConfigHandler.cs @@ -843,6 +843,10 @@ public class ConfigHandler profileItem.Address = profileItem.Address.TrimEx(); profileItem.Id = profileItem.Id.TrimEx(); profileItem.Network = string.Empty; + if (!Global.NaiveProxyProtocols.Contains(profileItem.HeaderType)) + { + profileItem.HeaderType = Global.NaiveProxyProtocols.FirstOrDefault()!; + } if (profileItem.StreamSecurity.IsNullOrEmpty()) { profileItem.StreamSecurity = Global.StreamSecurity; diff --git a/v2rayN/ServiceLib/Services/CoreConfig/Minimal/CoreConfigNaiveService.cs b/v2rayN/ServiceLib/Services/CoreConfig/Minimal/CoreConfigNaiveService.cs index f7a29230..0e1230cc 100644 --- a/v2rayN/ServiceLib/Services/CoreConfig/Minimal/CoreConfigNaiveService.cs +++ b/v2rayN/ServiceLib/Services/CoreConfig/Minimal/CoreConfigNaiveService.cs @@ -35,7 +35,7 @@ public class CoreConfigNaiveService configJsonNode["listen"] = Global.SocksProtocol + Global.Loopback + ":" + AppHandler.Instance.GetLocalPort(EInboundProtocol.split).ToString(); // outbound - configJsonNode["proxy"] = (node.Network == "quic" ? "quic://" : Global.HttpsProtocol) + node.Id + "@" + node.Address + ":" + node.Port; + configJsonNode["proxy"] = (node.HeaderType == "quic" ? "quic://" : Global.HttpsProtocol) + node.Id + "@" + node.Address + ":" + node.Port; ret.Success = true; ret.Data = JsonUtils.Serialize(configJsonNode, true);