mirror of
https://github.com/2dust/v2rayN.git
synced 2026-10-01 11:02:07 +03:00
@@ -49,6 +49,7 @@ public class CoreConfigContextBuilder
|
||||
RoutingItem = await ConfigHandler.GetDefaultRouting(config),
|
||||
IsWindows = Utils.IsWindows(),
|
||||
IsMacOS = Utils.IsMacOS(),
|
||||
IsLinux = Utils.IsLinux(),
|
||||
HasGlobalIPv6Address = Utils.HasGlobalIPv6Address(),
|
||||
ProtectCoreTypeList = config.TunModeItem.EnableTun ? [ECoreType.Xray, ECoreType.sing_box] : []
|
||||
};
|
||||
|
||||
@@ -24,6 +24,7 @@ public record CoreConfigContext
|
||||
|
||||
public bool IsWindows { get; init; }
|
||||
public bool IsMacOS { get; init; }
|
||||
public bool IsLinux { get; init; }
|
||||
|
||||
// Defaults to true so that a context built without this flag keeps routing IPv6 into the
|
||||
// tunnel; only a positive detection of the host having no global IPv6 address turns it off.
|
||||
|
||||
@@ -92,6 +92,10 @@ public class Inboundsettings4Ray
|
||||
public string? autoOutboundsInterface { get; set; }
|
||||
|
||||
public List<string>? dns { get; set; }
|
||||
|
||||
public bool? autoSystemDnsToGateway { get; set; }
|
||||
|
||||
public List<string>? autoSystemWfpBlockLeak { get; set; }
|
||||
}
|
||||
|
||||
public class Sniffing4Ray
|
||||
|
||||
@@ -90,6 +90,15 @@ public partial class CoreConfigV2rayService
|
||||
// tunInbound.sniffing.routeOnly = inbound.sniffing.routeOnly;
|
||||
tunInbound.sniffing.routeOnly = true;
|
||||
|
||||
if (context.IsWindows && _config.TunModeItem.StrictRoute == true)
|
||||
{
|
||||
tunInbound.settings.autoSystemWfpBlockLeak = ["dns", "misconfigtun"];
|
||||
}
|
||||
if (context.IsLinux)
|
||||
{
|
||||
tunInbound.settings.autoSystemDnsToGateway = true;
|
||||
}
|
||||
|
||||
if (_config.TunModeItem.RouteExcludeAddress is { Count: > 0 })
|
||||
{
|
||||
var wholeInternet = IPNetwork2.Parse("0.0.0.0/0");
|
||||
|
||||
Reference in New Issue
Block a user