Fix possible issues with load balancing

This commit is contained in:
2dust 2025-01-05 16:31:32 +08:00
parent 37cf23d5fe
commit b12b7a17e6
2 changed files with 7 additions and 10 deletions

View file

@ -333,7 +333,7 @@ namespace ServiceLib.Services.CoreConfig
outbounds = tagProxy, outbounds = tagProxy,
interrupt_exist_connections = false, interrupt_exist_connections = false,
}; };
singboxConfig.outbounds.Add(outUrltest); singboxConfig.outbounds.Insert(0, outUrltest);
//add selector outbound //add selector outbound
var outSelector = new Outbound4Sbox var outSelector = new Outbound4Sbox
@ -344,7 +344,7 @@ namespace ServiceLib.Services.CoreConfig
interrupt_exist_connections = false, interrupt_exist_connections = false,
}; };
outSelector.outbounds.Insert(0, outUrltest.tag); outSelector.outbounds.Insert(0, outUrltest.tag);
singboxConfig.outbounds.Add(outSelector); singboxConfig.outbounds.Insert(0, outSelector);
ret.Success = true; ret.Success = true;
ret.Data = JsonUtils.Serialize(singboxConfig); ret.Data = JsonUtils.Serialize(singboxConfig);

View file

@ -182,15 +182,12 @@ namespace ServiceLib.Services.CoreConfig
rule.balancerTag = balancer.tag; rule.balancerTag = balancer.tag;
} }
} }
else v2rayConfig.routing.rules.Add(new()
{ {
v2rayConfig.routing.rules.Add(new() network = "tcp,udp",
{ balancerTag = balancer.tag,
network = "tcp,udp", type = "field"
balancerTag = balancer.tag, });
type = "field"
});
}
ret.Success = true; ret.Success = true;
ret.Data = JsonUtils.Serialize(v2rayConfig); ret.Data = JsonUtils.Serialize(v2rayConfig);