Modify default fallback load balancing rule (#6889)
* Modify default fallback load balancing rule * Refine default fallback load balancing rule based on domain strategy
This commit is contained in:
@@ -182,12 +182,24 @@ namespace ServiceLib.Services.CoreConfig
|
||||
rule.balancerTag = balancer.tag;
|
||||
}
|
||||
}
|
||||
v2rayConfig.routing.rules.Add(new()
|
||||
if (v2rayConfig.routing.domainStrategy == "IPIfNonMatch")
|
||||
{
|
||||
network = "tcp,udp",
|
||||
balancerTag = balancer.tag,
|
||||
type = "field"
|
||||
});
|
||||
v2rayConfig.routing.rules.Add(new()
|
||||
{
|
||||
ip = ["0.0.0.0/0", "::/0"],
|
||||
balancerTag = balancer.tag,
|
||||
type = "field"
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
v2rayConfig.routing.rules.Add(new()
|
||||
{
|
||||
network = "tcp,udp",
|
||||
balancerTag = balancer.tag,
|
||||
type = "field"
|
||||
});
|
||||
}
|
||||
|
||||
ret.Success = true;
|
||||
ret.Data = JsonUtils.Serialize(v2rayConfig);
|
||||
|
||||
Reference in New Issue
Block a user