diff --git a/v2rayN/v2rayN/Handler/V2rayConfigHandler.cs b/v2rayN/v2rayN/Handler/V2rayConfigHandler.cs index 3242cbb124b..596a95b3f61 100644 --- a/v2rayN/v2rayN/Handler/V2rayConfigHandler.cs +++ b/v2rayN/v2rayN/Handler/V2rayConfigHandler.cs @@ -220,6 +220,10 @@ private static int routingUserRule(RulesItem rules, ref V2rayConfig v2rayConfig) var it = Utils.DeepCopy(rules); it.ip = null; it.type = "field"; + if (Utils.IsNullOrEmpty(rules.port)) + { + it.port = null; + } v2rayConfig.routing.rules.Add(it); hasDomainIp = true; } @@ -228,6 +232,10 @@ private static int routingUserRule(RulesItem rules, ref V2rayConfig v2rayConfig) var it = Utils.DeepCopy(rules); it.domain = null; it.type = "field"; + if (Utils.IsNullOrEmpty(rules.port)) + { + it.port = null; + } v2rayConfig.routing.rules.Add(it); hasDomainIp = true; }