Move exe direct rule before clash_mode (#7236)
Some checks failed
release Linux / build (Release) (push) Has been cancelled
release macOS / build (Release) (push) Has been cancelled
release Windows desktop (Avalonia UI) / build (Release) (push) Has been cancelled
release Windows / build (Release) (push) Has been cancelled

This commit is contained in:
DHR60 2025-05-05 13:59:14 +08:00 committed by GitHub
parent 8ea76fd318
commit 897a4e5635
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -979,26 +979,6 @@ public class CoreConfigSingboxService
try
{
var dnsOutbound = "dns_out";
if (!_config.Inbound.First().SniffingEnabled)
{
singboxConfig.route.rules.Add(new()
{
port = [53],
network = ["udp"],
outbound = dnsOutbound
});
}
singboxConfig.route.rules.Add(new()
{
outbound = Global.DirectTag,
clash_mode = ERuleMode.Direct.ToString()
});
singboxConfig.route.rules.Add(new()
{
outbound = Global.ProxyTag,
clash_mode = ERuleMode.Global.ToString()
});
if (_config.TunModeItem.EnableTun)
{
@ -1025,6 +1005,27 @@ public class CoreConfigSingboxService
});
}
if (!_config.Inbound.First().SniffingEnabled)
{
singboxConfig.route.rules.Add(new()
{
port = [53],
network = ["udp"],
outbound = dnsOutbound
});
}
singboxConfig.route.rules.Add(new()
{
outbound = Global.DirectTag,
clash_mode = ERuleMode.Direct.ToString()
});
singboxConfig.route.rules.Add(new()
{
outbound = Global.ProxyTag,
clash_mode = ERuleMode.Global.ToString()
});
var routing = await ConfigHandler.GetDefaultRouting(_config);
if (routing != null)
{