mirror of
https://github.com/2dust/v2rayN.git
synced 2026-05-30 01:34:08 +00:00
Fix
This commit is contained in:
parent
e38272b67b
commit
c01f0cde4d
6 changed files with 7 additions and 5 deletions
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
|
|
@ -26,4 +26,4 @@ jobs:
|
|||
|
||||
- name: Test Code
|
||||
working-directory: ./v2rayN
|
||||
run: dotnet test ./ServiceLib.Tests --logger GitHubActions
|
||||
run: dotnet test ./ServiceLib.Tests
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue