From cdc5d72cfaeed82119262a0348d005dbe9eb3542 Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Mon, 3 Mar 2025 14:36:01 +0800 Subject: [PATCH] Update CoreConfigSingboxService.cs --- .../Services/CoreConfig/CoreConfigSingboxService.cs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/v2rayN/ServiceLib/Services/CoreConfig/CoreConfigSingboxService.cs b/v2rayN/ServiceLib/Services/CoreConfig/CoreConfigSingboxService.cs index f4b9658c..475eed10 100644 --- a/v2rayN/ServiceLib/Services/CoreConfig/CoreConfigSingboxService.cs +++ b/v2rayN/ServiceLib/Services/CoreConfig/CoreConfigSingboxService.cs @@ -733,15 +733,10 @@ namespace ServiceLib.Services.CoreConfig if (node.Ports.IsNotEmpty()) { outbound.server_port = null; - outbound.server_ports = new List(); - var ports = node.Ports.Split(',') - .Select(p => p.Trim()) - .Where(p => !string.IsNullOrEmpty(p)) + outbound.server_ports = node.Ports.Split(',') + .Where(p => p.Trim().IsNotEmpty()) + .Select(p => p.Replace('-', ':')) .ToList(); - foreach (var it in ports) - { - outbound.server_ports.Add(it.Contains('-') ? it.Replace('-', ':') : it); - } outbound.hop_interval = _config.HysteriaItem.HopInterval > 0 ? $"{_config.HysteriaItem.HopInterval}s" : null; }