Add process to routing domains

https://github.com/2dust/v2rayN/issues/8757
This commit is contained in:
2dust
2026-02-05 16:52:48 +08:00
parent fdb733fa72
commit bceebc1661
6 changed files with 19 additions and 11 deletions
@@ -277,7 +277,7 @@ public partial class CoreConfigSingboxService
}
}
if (_config.TunModeItem.EnableTun && item.Process?.Count > 0)
if (item.Process?.Count > 0)
{
var ruleProcName = JsonUtils.DeepCopy(rule3);
ruleProcName.process_name ??= [];
@@ -304,11 +304,7 @@ public partial class CoreConfigSingboxService
}
// sing-box strictly matches the exe suffix on Windows
var procName = process;
if (Utils.IsWindows() && !procName.EndsWith(".exe", StringComparison.OrdinalIgnoreCase))
{
procName += ".exe";
}
var procName = Utils.GetExeName(process);
ruleProcName.process_name.Add(procName);
}
@@ -109,7 +109,7 @@ public partial class CoreConfigV2rayService
v2rayConfig.routing.rules.Add(it);
hasDomainIp = true;
}
if (_config.TunModeItem.EnableTun && rule.process?.Count > 0)
if (rule.process?.Count > 0)
{
var it = JsonUtils.DeepCopy(rule);
it.domain = null;