mirror of
https://github.com/2dust/v2rayN.git
synced 2025-07-02 04:52:09 +00:00
Fix possible issues with load balancing
This commit is contained in:
parent
37cf23d5fe
commit
b12b7a17e6
2 changed files with 7 additions and 10 deletions
|
@ -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);
|
||||||
|
|
|
@ -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",
|
network = "tcp,udp",
|
||||||
balancerTag = balancer.tag,
|
balancerTag = balancer.tag,
|
||||||
type = "field"
|
type = "field"
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
ret.Success = true;
|
ret.Success = true;
|
||||||
ret.Data = JsonUtils.Serialize(v2rayConfig);
|
ret.Data = JsonUtils.Serialize(v2rayConfig);
|
||||||
|
|
Loading…
Reference in a new issue