Add Hy2 Port hopping URI support (#6848)

This commit is contained in:
DHR60
2025-03-03 14:11:53 +08:00
committed by GitHub
parent 67fe6ac3d8
commit 8dcf5c5b90
2 changed files with 15 additions and 1 deletions
@@ -733,7 +733,15 @@ namespace ServiceLib.Services.CoreConfig
if (node.Ports.IsNotEmpty())
{
outbound.server_port = null;
outbound.server_ports = node.Ports.Split(",").ToList();
outbound.server_ports = new List<string>();
var ports = node.Ports.Split(',')
.Select(p => p.Trim())
.Where(p => !string.IsNullOrEmpty(p))
.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;
}