mirror of
https://github.com/2dust/v2rayN.git
synced 2025-04-20 06:02:23 +00:00
Refine default fallback load balancing rule based on domain strategy
This commit is contained in:
parent
06f1fa3618
commit
056b787a10
1 changed files with 17 additions and 5 deletions
|
@ -182,12 +182,24 @@ namespace ServiceLib.Services.CoreConfig
|
||||||
rule.balancerTag = balancer.tag;
|
rule.balancerTag = balancer.tag;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (v2rayConfig.routing.domainStrategy == "IPIfNonMatch")
|
||||||
|
{
|
||||||
v2rayConfig.routing.rules.Add(new()
|
v2rayConfig.routing.rules.Add(new()
|
||||||
{
|
{
|
||||||
ip = ["0.0.0.0/0", "::/0"],
|
ip = ["0.0.0.0/0", "::/0"],
|
||||||
balancerTag = balancer.tag,
|
balancerTag = balancer.tag,
|
||||||
type = "field"
|
type = "field"
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
v2rayConfig.routing.rules.Add(new()
|
||||||
|
{
|
||||||
|
network = "tcp,udp",
|
||||||
|
balancerTag = balancer.tag,
|
||||||
|
type = "field"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
ret.Success = true;
|
ret.Success = true;
|
||||||
ret.Data = JsonUtils.Serialize(v2rayConfig);
|
ret.Data = JsonUtils.Serialize(v2rayConfig);
|
||||||
|
|
Loading…
Reference in a new issue