Fix possible issues with load balancing

https://github.com/2dust/v2rayN/issues/6429
pull/6443/head
2dust 2025-01-05 14:49:53 +08:00
parent aae5906311
commit 5d4bd2fee6
3 changed files with 19 additions and 22 deletions

View File

@ -5,24 +5,25 @@
"loglevel": "warning"
},
"inbounds": [],
"outbounds": [{
"outbounds": [
{
"tag": "proxy",
"protocol": "vmess",
"settings": {
"vnext": [{
"address": "v2ray.cool",
"port": 10086,
"address": "",
"port": 0,
"users": [{
"id": "a3482e88-686a-4a58-8126-99c9df64b7bf",
"id": "",
"security": "auto"
}]
}],
"servers": [{
"address": "v2ray.cool",
"method": "chacha20",
"address": "",
"method": "",
"ota": false,
"password": "123456",
"port": 10086,
"password": "",
"port": 0,
"level": 1
}]
},
@ -35,27 +36,23 @@
},
{
"protocol": "freedom",
"settings": {},
"tag": "direct"
},
{
"protocol": "blackhole",
"tag": "block",
"settings": {
"response": {
"type": "http"
}
}
"tag": "block"
}
],
"routing": {
"domainStrategy": "IPIfNonMatch",
"rules": [
{
"inboundTag": ["api"],
"outboundTag": "api",
"type": "field"
}
{
"inboundTag": [
"api"
],
"outboundTag": "api",
"type": "field"
}
]
}
}

View File

@ -313,7 +313,7 @@ namespace ServiceLib.Services.CoreConfig
var outbound = JsonUtils.Deserialize<Outbound4Sbox>(txtOutbound);
await GenOutbound(item, outbound);
outbound.tag = $"{Global.ProxyTag}-{tagProxy.Count + 1}";
singboxConfig.outbounds.Add(outbound);
singboxConfig.outbounds.Insert(0, outbound);
tagProxy.Add(outbound.tag);
}
if (tagProxy.Count <= 0)

View File

@ -154,7 +154,7 @@ namespace ServiceLib.Services.CoreConfig
var outbound = JsonUtils.Deserialize<Outbounds4Ray>(txtOutbound);
await GenOutbound(item, outbound);
outbound.tag = $"{Global.ProxyTag}-{tagProxy.Count + 1}";
v2rayConfig.outbounds.Add(outbound);
v2rayConfig.outbounds.Insert(0, outbound);
tagProxy.Add(outbound.tag);
}
if (tagProxy.Count <= 0)