diff --git a/v2rayN/ServiceLib/Services/CoreConfig/Singbox/SingboxRoutingService.cs b/v2rayN/ServiceLib/Services/CoreConfig/Singbox/SingboxRoutingService.cs index 0b364785..9fec047c 100644 --- a/v2rayN/ServiceLib/Services/CoreConfig/Singbox/SingboxRoutingService.cs +++ b/v2rayN/ServiceLib/Services/CoreConfig/Singbox/SingboxRoutingService.cs @@ -368,6 +368,13 @@ public partial class CoreConfigSingboxService return Global.ProxyTag; } + var tag = Global.ProxyTag + node.IndexId.ToString(); + if (singboxConfig.outbounds.Any(o => o.tag == tag) + || (singboxConfig.endpoints != null && singboxConfig.endpoints.Any(e => e.tag == tag))) + { + return tag; + } + var server = await GenServer(node); if (server is null) { diff --git a/v2rayN/ServiceLib/Services/CoreConfig/V2ray/V2rayRoutingService.cs b/v2rayN/ServiceLib/Services/CoreConfig/V2ray/V2rayRoutingService.cs index 1cb46bf2..d39ea833 100644 --- a/v2rayN/ServiceLib/Services/CoreConfig/V2ray/V2rayRoutingService.cs +++ b/v2rayN/ServiceLib/Services/CoreConfig/V2ray/V2rayRoutingService.cs @@ -131,10 +131,16 @@ public partial class CoreConfigV2rayService return Global.ProxyTag; } + var tag = Global.ProxyTag + node.IndexId.ToString(); + if (v2rayConfig.outbounds.Any(p => p.tag == tag)) + { + return tag; + } + var txtOutbound = EmbedUtils.GetEmbedText(Global.V2raySampleOutbound); var outbound = JsonUtils.Deserialize(txtOutbound); await GenOutbound(node, outbound); - outbound.tag = Global.ProxyTag + node.IndexId.ToString(); + outbound.tag = tag; v2rayConfig.outbounds.Add(outbound); return outbound.tag;