Fixes config generation

This commit is contained in:
DHR60 2025-04-12 12:05:47 +08:00
parent 9d95143d85
commit 736ba9e52c
2 changed files with 4 additions and 1 deletions

View file

@ -853,6 +853,7 @@ public class CoreConfigSingboxService
}; };
endpoints.private_key = node.Id; endpoints.private_key = node.Id;
endpoints.mtu = node.ShortId.IsNullOrEmpty() ? Global.TunMtus.First() : node.ShortId.ToInt(); endpoints.mtu = node.ShortId.IsNullOrEmpty() ? Global.TunMtus.First() : node.ShortId.ToInt();
endpoints.peers = new() { peer };
break; break;
} }
} }
@ -1088,6 +1089,7 @@ public class CoreConfigSingboxService
var nextEndpoint = JsonUtils.Deserialize<Endpoints4Sbox>(txtOutbound); var nextEndpoint = JsonUtils.Deserialize<Endpoints4Sbox>(txtOutbound);
await GenEndpoint(nextNode, nextEndpoint); await GenEndpoint(nextNode, nextEndpoint);
nextEndpoint.tag = Global.ProxyTag; nextEndpoint.tag = Global.ProxyTag;
singboxConfig.endpoints ??= new();
singboxConfig.endpoints.Insert(0, nextEndpoint); singboxConfig.endpoints.Insert(0, nextEndpoint);
nextEndpoint.detour = tag; nextEndpoint.detour = tag;
@ -1097,6 +1099,7 @@ public class CoreConfigSingboxService
var nextOutbound = JsonUtils.Deserialize<Outbound4Sbox>(txtOutbound); var nextOutbound = JsonUtils.Deserialize<Outbound4Sbox>(txtOutbound);
await GenOutbound(nextNode, nextOutbound); await GenOutbound(nextNode, nextOutbound);
nextOutbound.tag = Global.ProxyTag; nextOutbound.tag = Global.ProxyTag;
singboxConfig.outbounds ??= new();
singboxConfig.outbounds.Insert(0, nextOutbound); singboxConfig.outbounds.Insert(0, nextOutbound);
nextOutbound.detour = tag; nextOutbound.detour = tag;

View file

@ -1311,7 +1311,7 @@ public class CoreConfigV2rayService
&& nextNode.ConfigType != EConfigType.Custom && nextNode.ConfigType != EConfigType.Custom
&& nextNode.ConfigType != EConfigType.Hysteria2 && nextNode.ConfigType != EConfigType.Hysteria2
&& nextNode.ConfigType != EConfigType.TUIC && nextNode.ConfigType != EConfigType.TUIC
&& prevNode.ConfigType != EConfigType.Anytls) && nextNode.ConfigType != EConfigType.Anytls)
{ {
var nextOutbound = JsonUtils.Deserialize<Outbounds4Ray>(txtOutbound); var nextOutbound = JsonUtils.Deserialize<Outbounds4Ray>(txtOutbound);
await GenOutbound(nextNode, nextOutbound); await GenOutbound(nextNode, nextOutbound);