From 8d94997ba05973955e65daeff103085784138363 Mon Sep 17 00:00:00 2001 From: DHR60 <192860629+DHR60@users.noreply.github.com> Date: Fri, 26 Jun 2026 01:04:44 +0000 Subject: [PATCH] xray tun for linux and macos (#9632) --- v2rayN/ServiceLib/Handler/ConfigHandler.cs | 3 +-- v2rayN/ServiceLib/Manager/CoreManager.cs | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/v2rayN/ServiceLib/Handler/ConfigHandler.cs b/v2rayN/ServiceLib/Handler/ConfigHandler.cs index bc4914b7..5e5e30b5 100644 --- a/v2rayN/ServiceLib/Handler/ConfigHandler.cs +++ b/v2rayN/ServiceLib/Handler/ConfigHandler.cs @@ -1494,8 +1494,7 @@ public static class ConfigHandler public static ProfileItem? GetPreSocksItem(Config config, ProfileItem node, ECoreType coreType) { ProfileItem? itemSocks = null; - var enableLegacyProtect = config.TunModeItem.EnableLegacyProtect - || Utils.IsNonWindows(); + var enableLegacyProtect = config.TunModeItem.EnableLegacyProtect; if (node.ConfigType != EConfigType.Custom && coreType != ECoreType.sing_box && config.TunModeItem.EnableTun diff --git a/v2rayN/ServiceLib/Manager/CoreManager.cs b/v2rayN/ServiceLib/Manager/CoreManager.cs index 41d2343b..84ff7f38 100644 --- a/v2rayN/ServiceLib/Manager/CoreManager.cs +++ b/v2rayN/ServiceLib/Manager/CoreManager.cs @@ -230,7 +230,7 @@ public class CoreManager { if (mayNeedSudo && _config.TunModeItem.EnableTun - && (coreInfo.CoreType is ECoreType.sing_box or ECoreType.mihomo) + && (coreInfo.CoreType is ECoreType.sing_box or ECoreType.mihomo or ECoreType.Xray) && Utils.IsNonWindows()) { _linuxSudo = true;