mirror of
https://github.com/2dust/v2rayN.git
synced 2026-11-09 22:15:00 +03:00
@@ -48,6 +48,7 @@ public class CoreConfigContextBuilder
|
||||
RawDnsItem = await AppManager.Instance.GetDNSItem(coreType),
|
||||
RoutingItem = await ConfigHandler.GetDefaultRouting(config),
|
||||
IsWindows = Utils.IsWindows(),
|
||||
IsMacOS = Utils.IsMacOS(),
|
||||
};
|
||||
var validatorResult = NodeValidatorResult.Empty();
|
||||
var (actNode, nodeValidatorResult) = await ResolveNodeAsync(context, node);
|
||||
|
||||
@@ -19,4 +19,5 @@ public record CoreConfigContext
|
||||
public HashSet<string> ProtectDomainList { get; init; } = [];
|
||||
|
||||
public bool IsWindows { get; init; }
|
||||
public bool IsMacOS { get; init; }
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ public partial class CoreConfigSingboxService
|
||||
}
|
||||
|
||||
var tunInbound = JsonUtils.Deserialize<Inbound4Sbox>(EmbedUtils.GetEmbedText(Global.TunSingboxInboundFileName)) ?? new Inbound4Sbox { };
|
||||
tunInbound.interface_name = Utils.IsMacOS() ? $"utun{new Random().Next(99)}" : "singbox_tun";
|
||||
tunInbound.interface_name = context.IsMacOS ? $"utun{new Random().Next(99)}" : "singbox_tun";
|
||||
tunInbound.mtu = _config.TunModeItem.Mtu;
|
||||
tunInbound.auto_route = _config.TunModeItem.AutoRoute;
|
||||
tunInbound.strict_route = _config.TunModeItem.StrictRoute;
|
||||
|
||||
@@ -200,9 +200,9 @@ public partial class CoreConfigV2rayService
|
||||
if (normalizedDomain.StartsWith(Global.GeoSitePrefix) || normalizedDomain.StartsWith("ext:"))
|
||||
{
|
||||
var isExpectedDomain = !regionName.IsNullOrEmpty()
|
||||
|| normalizedDomain.EndsWith($"-{regionName}")
|
||||
&& (normalizedDomain.EndsWith($"-{regionName}")
|
||||
|| normalizedDomain.EndsWith($"@{regionName}")
|
||||
|| normalizedDomain == Global.GeoSitePrefix + regionName;
|
||||
|| normalizedDomain == Global.GeoSitePrefix + regionName);
|
||||
var targetList = isExpectedDomain ? expectedDomainList : directGeositeList;
|
||||
targetList.Add(normalizedDomain);
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ public partial class CoreConfigV2rayService
|
||||
_config.TunModeItem.Mtu = Global.TunMtus.First();
|
||||
}
|
||||
var tunInbound = JsonUtils.Deserialize<Inbounds4Ray>(EmbedUtils.GetEmbedText(Global.V2raySampleTunInbound)) ?? new Inbounds4Ray { };
|
||||
tunInbound.settings.name = Utils.IsMacOS() ? $"utun{new Random().Next(99)}" : "xray_tun";
|
||||
tunInbound.settings.name = context.IsMacOS ? $"utun{new Random().Next(99)}" : "xray_tun";
|
||||
tunInbound.settings.MTU = _config.TunModeItem.Mtu;
|
||||
if (_config.TunModeItem.EnableIPv6Address == false)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user