mirror of
https://github.com/2dust/v2rayN.git
synced 2026-02-28 21:23:04 +00:00
Simplify DNS Settings
This commit is contained in:
parent
ffe401a26d
commit
21ca5c10b8
23 changed files with 126 additions and 180 deletions
|
|
@ -329,13 +329,13 @@ public class Global
|
||||||
IPOnDemand
|
IPOnDemand
|
||||||
];
|
];
|
||||||
|
|
||||||
public static readonly List<string> DomainStrategies4Singbox =
|
public static readonly List<string> DomainStrategies4Sbox =
|
||||||
[
|
[
|
||||||
"ipv4_only",
|
"",
|
||||||
"ipv6_only",
|
|
||||||
"prefer_ipv4",
|
"prefer_ipv4",
|
||||||
"prefer_ipv6",
|
"prefer_ipv6",
|
||||||
""
|
"ipv4_only",
|
||||||
|
"ipv6_only"
|
||||||
];
|
];
|
||||||
|
|
||||||
public static readonly List<string> Fingerprints =
|
public static readonly List<string> Fingerprints =
|
||||||
|
|
@ -377,23 +377,23 @@ public class Global
|
||||||
""
|
""
|
||||||
];
|
];
|
||||||
|
|
||||||
public static readonly List<string> DomainStrategy4Freedoms =
|
public static readonly List<string> DomainStrategy =
|
||||||
[
|
[
|
||||||
"AsIs",
|
"AsIs",
|
||||||
"UseIP",
|
"UseIP",
|
||||||
|
"UseIPv4v6",
|
||||||
|
"UseIPv6v4",
|
||||||
"UseIPv4",
|
"UseIPv4",
|
||||||
"UseIPv6",
|
"UseIPv6",
|
||||||
""
|
""
|
||||||
];
|
];
|
||||||
|
|
||||||
public static readonly List<string> SingboxDomainStrategy4Out =
|
public static readonly Dictionary<string, string> DomainStrategy4SboxMap =
|
||||||
[
|
DomainStrategy
|
||||||
"",
|
.Where(s => s.StartsWith("UseIPv4", StringComparison.Ordinal) || s.StartsWith("UseIPv6", StringComparison.Ordinal))
|
||||||
"ipv4_only",
|
.ToDictionary(
|
||||||
"prefer_ipv4",
|
key => key,
|
||||||
"prefer_ipv6",
|
key => key.StartsWith("UseIPv4", StringComparison.Ordinal) ? "prefer_ipv4" : "prefer_ipv6");
|
||||||
"ipv6_only"
|
|
||||||
];
|
|
||||||
|
|
||||||
public static readonly List<string> DomainDirectDNSAddress =
|
public static readonly List<string> DomainDirectDNSAddress =
|
||||||
[
|
[
|
||||||
|
|
|
||||||
|
|
@ -265,9 +265,8 @@ public class SimpleDNSItem
|
||||||
public string? DirectDNS { get; set; }
|
public string? DirectDNS { get; set; }
|
||||||
public string? RemoteDNS { get; set; }
|
public string? RemoteDNS { get; set; }
|
||||||
public string? BootstrapDNS { get; set; }
|
public string? BootstrapDNS { get; set; }
|
||||||
public string? RayStrategy4Freedom { get; set; }
|
public string? Strategy4Freedom { get; set; }
|
||||||
public string? SingboxStrategy4Direct { get; set; }
|
public string? Strategy4Proxy { get; set; }
|
||||||
public string? SingboxStrategy4Proxy { get; set; }
|
|
||||||
public string? Hosts { get; set; }
|
public string? Hosts { get; set; }
|
||||||
public string? DirectExpectedIPs { get; set; }
|
public string? DirectExpectedIPs { get; set; }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -105,6 +105,8 @@ public class Outbounds4Ray
|
||||||
|
|
||||||
public string protocol { get; set; }
|
public string protocol { get; set; }
|
||||||
|
|
||||||
|
public string? targetStrategy { get; set; }
|
||||||
|
|
||||||
public Outboundsettings4Ray settings { get; set; }
|
public Outboundsettings4Ray settings { get; set; }
|
||||||
|
|
||||||
public StreamSettings4Ray streamSettings { get; set; }
|
public StreamSettings4Ray streamSettings { get; set; }
|
||||||
|
|
|
||||||
45
v2rayN/ServiceLib/Resx/ResUI.Designer.cs
generated
45
v2rayN/ServiceLib/Resx/ResUI.Designer.cs
generated
|
|
@ -2727,6 +2727,15 @@ namespace ServiceLib.Resx {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 Direct Resolution Strategy 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string TbDirectResolveStrategy {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("TbDirectResolveStrategy", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Display GUI 的本地化字符串。
|
/// 查找类似 Display GUI 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -3222,6 +3231,15 @@ namespace ServiceLib.Resx {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 Remote Resolution Strategy 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string TbRemoteResolveStrategy {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("TbRemoteResolveStrategy", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Camouflage domain(host) 的本地化字符串。
|
/// 查找类似 Camouflage domain(host) 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -3357,15 +3375,6 @@ namespace ServiceLib.Resx {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 查找类似 sing-box Direct Resolution Strategy 的本地化字符串。
|
|
||||||
/// </summary>
|
|
||||||
public static string TbSBDirectResolveStrategy {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("TbSBDirectResolveStrategy", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 sing-box Full Config Template 的本地化字符串。
|
/// 查找类似 sing-box Full Config Template 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -3384,15 +3393,6 @@ namespace ServiceLib.Resx {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 查找类似 sing-box Remote Resolution Strategy 的本地化字符串。
|
|
||||||
/// </summary>
|
|
||||||
public static string TbSBRemoteResolveStrategy {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("TbSBRemoteResolveStrategy", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Encryption method (security) 的本地化字符串。
|
/// 查找类似 Encryption method (security) 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -4419,15 +4419,6 @@ namespace ServiceLib.Resx {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 查找类似 xray Freedom Resolution Strategy 的本地化字符串。
|
|
||||||
/// </summary>
|
|
||||||
public static string TbXrayFreedomStrategy {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("TbXrayFreedomStrategy", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 The delay: {0} ms, {1} 的本地化字符串。
|
/// 查找类似 The delay: {0} ms, {1} 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -1422,14 +1422,11 @@
|
||||||
<data name="TbRemoteDNSTips" xml:space="preserve">
|
<data name="TbRemoteDNSTips" xml:space="preserve">
|
||||||
<value>Via proxy — please ensure remote availability</value>
|
<value>Via proxy — please ensure remote availability</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbXrayFreedomStrategy" xml:space="preserve">
|
<data name="TbDirectResolveStrategy" xml:space="preserve">
|
||||||
<value>xray Freedom Resolution Strategy</value>
|
<value>Direct Resolution Strategy</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbSBDirectResolveStrategy" xml:space="preserve">
|
<data name="TbRemoteResolveStrategy" xml:space="preserve">
|
||||||
<value>sing-box Direct Resolution Strategy</value>
|
<value>Remote Resolution Strategy</value>
|
||||||
</data>
|
|
||||||
<data name="TbSBRemoteResolveStrategy" xml:space="preserve">
|
|
||||||
<value>sing-box Remote Resolution Strategy</value>
|
|
||||||
</data>
|
</data>
|
||||||
<data name="TbAddCommonDNSHosts" xml:space="preserve">
|
<data name="TbAddCommonDNSHosts" xml:space="preserve">
|
||||||
<value>Add Common DNS Hosts</value>
|
<value>Add Common DNS Hosts</value>
|
||||||
|
|
|
||||||
|
|
@ -1419,14 +1419,11 @@
|
||||||
<data name="TbRemoteDNSTips" xml:space="preserve">
|
<data name="TbRemoteDNSTips" xml:space="preserve">
|
||||||
<value>Via le proxy ; assurez-vous que le serveur distant est disponible</value>
|
<value>Via le proxy ; assurez-vous que le serveur distant est disponible</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbXrayFreedomStrategy" xml:space="preserve">
|
<data name="TbDirectResolveStrategy" xml:space="preserve">
|
||||||
<value>Stratégie de résolution xray freedom</value>
|
<value>Stratégie de résolution directe</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbSBDirectResolveStrategy" xml:space="preserve">
|
<data name="TbRemoteResolveStrategy" xml:space="preserve">
|
||||||
<value>Stratégie de résolution directe sing-box</value>
|
<value>Stratégie de résolution distante</value>
|
||||||
</data>
|
|
||||||
<data name="TbSBRemoteResolveStrategy" xml:space="preserve">
|
|
||||||
<value>Stratégie de résolution distante sing-box</value>
|
|
||||||
</data>
|
</data>
|
||||||
<data name="TbAddCommonDNSHosts" xml:space="preserve">
|
<data name="TbAddCommonDNSHosts" xml:space="preserve">
|
||||||
<value>Ajouter des hôtes DNS courants</value>
|
<value>Ajouter des hôtes DNS courants</value>
|
||||||
|
|
|
||||||
|
|
@ -1422,14 +1422,11 @@
|
||||||
<data name="TbRemoteDNSTips" xml:space="preserve">
|
<data name="TbRemoteDNSTips" xml:space="preserve">
|
||||||
<value>Via proxy — please ensure remote availability</value>
|
<value>Via proxy — please ensure remote availability</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbXrayFreedomStrategy" xml:space="preserve">
|
<data name="TbDirectResolveStrategy" xml:space="preserve">
|
||||||
<value>xray Freedom Resolution Strategy</value>
|
<value>Direct Resolution Strategy</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbSBDirectResolveStrategy" xml:space="preserve">
|
<data name="TbRemoteResolveStrategy" xml:space="preserve">
|
||||||
<value>sing-box Direct Resolution Strategy</value>
|
<value>Remote Resolution Strategy</value>
|
||||||
</data>
|
|
||||||
<data name="TbSBRemoteResolveStrategy" xml:space="preserve">
|
|
||||||
<value>sing-box Remote Resolution Strategy</value>
|
|
||||||
</data>
|
</data>
|
||||||
<data name="TbAddCommonDNSHosts" xml:space="preserve">
|
<data name="TbAddCommonDNSHosts" xml:space="preserve">
|
||||||
<value>Add Common DNS Hosts</value>
|
<value>Add Common DNS Hosts</value>
|
||||||
|
|
|
||||||
|
|
@ -1422,14 +1422,11 @@
|
||||||
<data name="TbRemoteDNSTips" xml:space="preserve">
|
<data name="TbRemoteDNSTips" xml:space="preserve">
|
||||||
<value>Via proxy — please ensure remote availability</value>
|
<value>Via proxy — please ensure remote availability</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbXrayFreedomStrategy" xml:space="preserve">
|
<data name="TbDirectResolveStrategy" xml:space="preserve">
|
||||||
<value>xray Freedom Resolution Strategy</value>
|
<value>Direct Resolution Strategy</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbSBDirectResolveStrategy" xml:space="preserve">
|
<data name="TbRemoteResolveStrategy" xml:space="preserve">
|
||||||
<value>sing-box Direct Resolution Strategy</value>
|
<value>Remote Resolution Strategy</value>
|
||||||
</data>
|
|
||||||
<data name="TbSBRemoteResolveStrategy" xml:space="preserve">
|
|
||||||
<value>sing-box Remote Resolution Strategy</value>
|
|
||||||
</data>
|
</data>
|
||||||
<data name="TbAddCommonDNSHosts" xml:space="preserve">
|
<data name="TbAddCommonDNSHosts" xml:space="preserve">
|
||||||
<value>Add Common DNS Hosts</value>
|
<value>Add Common DNS Hosts</value>
|
||||||
|
|
|
||||||
|
|
@ -1422,14 +1422,11 @@
|
||||||
<data name="TbRemoteDNSTips" xml:space="preserve">
|
<data name="TbRemoteDNSTips" xml:space="preserve">
|
||||||
<value>Via proxy — please ensure remote availability</value>
|
<value>Via proxy — please ensure remote availability</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbXrayFreedomStrategy" xml:space="preserve">
|
<data name="TbDirectResolveStrategy" xml:space="preserve">
|
||||||
<value>Стратегия резолвинга Freedom (Xray)</value>
|
<value>Стратегия прямого резолвинга</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbSBDirectResolveStrategy" xml:space="preserve">
|
<data name="TbRemoteResolveStrategy" xml:space="preserve">
|
||||||
<value>Стратегия прямого резолвинга (sing-box)</value>
|
<value>Стратегия удалённого резолвинга</value>
|
||||||
</data>
|
|
||||||
<data name="TbSBRemoteResolveStrategy" xml:space="preserve">
|
|
||||||
<value>Стратегия удалённого резолвинга (sing-box)</value>
|
|
||||||
</data>
|
</data>
|
||||||
<data name="TbAddCommonDNSHosts" xml:space="preserve">
|
<data name="TbAddCommonDNSHosts" xml:space="preserve">
|
||||||
<value>Добавить стандартные записи hosts (DNS)</value>
|
<value>Добавить стандартные записи hosts (DNS)</value>
|
||||||
|
|
|
||||||
|
|
@ -1419,14 +1419,11 @@
|
||||||
<data name="TbRemoteDNSTips" xml:space="preserve">
|
<data name="TbRemoteDNSTips" xml:space="preserve">
|
||||||
<value>通过代理,请确保远程可用</value>
|
<value>通过代理,请确保远程可用</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbXrayFreedomStrategy" xml:space="preserve">
|
<data name="TbDirectResolveStrategy" xml:space="preserve">
|
||||||
<value>xray freedom 解析策略</value>
|
<value>直连解析策略</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbSBDirectResolveStrategy" xml:space="preserve">
|
<data name="TbRemoteResolveStrategy" xml:space="preserve">
|
||||||
<value>sing-box 直连解析策略</value>
|
<value>远程解析策略</value>
|
||||||
</data>
|
|
||||||
<data name="TbSBRemoteResolveStrategy" xml:space="preserve">
|
|
||||||
<value>sing-box 远程解析策略</value>
|
|
||||||
</data>
|
</data>
|
||||||
<data name="TbAddCommonDNSHosts" xml:space="preserve">
|
<data name="TbAddCommonDNSHosts" xml:space="preserve">
|
||||||
<value>添加常用 DNS Hosts</value>
|
<value>添加常用 DNS Hosts</value>
|
||||||
|
|
|
||||||
|
|
@ -1419,14 +1419,11 @@
|
||||||
<data name="TbRemoteDNSTips" xml:space="preserve">
|
<data name="TbRemoteDNSTips" xml:space="preserve">
|
||||||
<value>通过代理,请确保远程可用</value>
|
<value>通过代理,请确保远程可用</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbXrayFreedomStrategy" xml:space="preserve">
|
<data name="TbDirectResolveStrategy" xml:space="preserve">
|
||||||
<value>xray freedom 解析策略</value>
|
<value>直連解析策略</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbSBDirectResolveStrategy" xml:space="preserve">
|
<data name="TbRemoteResolveStrategy" xml:space="preserve">
|
||||||
<value>sing-box 直連解析策略</value>
|
<value>遠程解析策略</value>
|
||||||
</data>
|
|
||||||
<data name="TbSBRemoteResolveStrategy" xml:space="preserve">
|
|
||||||
<value>sing-box 遠程解析策略</value>
|
|
||||||
</data>
|
</data>
|
||||||
<data name="TbAddCommonDNSHosts" xml:space="preserve">
|
<data name="TbAddCommonDNSHosts" xml:space="preserve">
|
||||||
<value>新增常用 DNS Hosts</value>
|
<value>新增常用 DNS Hosts</value>
|
||||||
|
|
|
||||||
|
|
@ -175,18 +175,18 @@ public partial class CoreConfigSingboxService
|
||||||
singboxConfig.dns.rules ??= new List<Rule4Sbox>();
|
singboxConfig.dns.rules ??= new List<Rule4Sbox>();
|
||||||
|
|
||||||
singboxConfig.dns.rules.AddRange(new[]
|
singboxConfig.dns.rules.AddRange(new[]
|
||||||
{
|
{
|
||||||
new Rule4Sbox { ip_accept_any = true, server = Global.SingboxHostsDNSTag },
|
new Rule4Sbox { ip_accept_any = true, server = Global.SingboxHostsDNSTag },
|
||||||
new Rule4Sbox
|
new Rule4Sbox
|
||||||
{
|
{
|
||||||
server = Global.SingboxRemoteDNSTag,
|
server = Global.SingboxRemoteDNSTag,
|
||||||
strategy = simpleDNSItem.SingboxStrategy4Proxy.NullIfEmpty(),
|
strategy = Global.DomainStrategy4SboxMap.GetValueOrDefault(simpleDNSItem.Strategy4Proxy),
|
||||||
clash_mode = ERuleMode.Global.ToString()
|
clash_mode = ERuleMode.Global.ToString()
|
||||||
},
|
},
|
||||||
new Rule4Sbox
|
new Rule4Sbox
|
||||||
{
|
{
|
||||||
server = Global.SingboxDirectDNSTag,
|
server = Global.SingboxDirectDNSTag,
|
||||||
strategy = simpleDNSItem.SingboxStrategy4Direct.NullIfEmpty(),
|
strategy = Global.DomainStrategy4SboxMap.GetValueOrDefault(simpleDNSItem.Strategy4Freedom),
|
||||||
clash_mode = ERuleMode.Direct.ToString()
|
clash_mode = ERuleMode.Direct.ToString()
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -309,7 +309,7 @@ public partial class CoreConfigSingboxService
|
||||||
if (item.OutboundTag == Global.DirectTag)
|
if (item.OutboundTag == Global.DirectTag)
|
||||||
{
|
{
|
||||||
rule.server = Global.SingboxDirectDNSTag;
|
rule.server = Global.SingboxDirectDNSTag;
|
||||||
rule.strategy = string.IsNullOrEmpty(simpleDNSItem.SingboxStrategy4Direct) ? null : simpleDNSItem.SingboxStrategy4Direct;
|
rule.strategy = Global.DomainStrategy4SboxMap.GetValueOrDefault(simpleDNSItem.Strategy4Freedom);
|
||||||
|
|
||||||
if (expectedIPsRegions.Count > 0 && rule.geosite?.Count > 0)
|
if (expectedIPsRegions.Count > 0 && rule.geosite?.Count > 0)
|
||||||
{
|
{
|
||||||
|
|
@ -343,7 +343,7 @@ public partial class CoreConfigSingboxService
|
||||||
singboxConfig.dns.rules.Add(rule4Fake);
|
singboxConfig.dns.rules.Add(rule4Fake);
|
||||||
}
|
}
|
||||||
rule.server = Global.SingboxRemoteDNSTag;
|
rule.server = Global.SingboxRemoteDNSTag;
|
||||||
rule.strategy = string.IsNullOrEmpty(simpleDNSItem.SingboxStrategy4Proxy) ? null : simpleDNSItem.SingboxStrategy4Proxy;
|
rule.strategy = Global.DomainStrategy4SboxMap.GetValueOrDefault(simpleDNSItem.Strategy4Proxy);
|
||||||
}
|
}
|
||||||
|
|
||||||
singboxConfig.dns.rules.Add(rule);
|
singboxConfig.dns.rules.Add(rule);
|
||||||
|
|
|
||||||
|
|
@ -7,21 +7,21 @@ public partial class CoreConfigSingboxService
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
singboxConfig.route.final = Global.ProxyTag;
|
singboxConfig.route.final = Global.ProxyTag;
|
||||||
var item = _config.SimpleDNSItem;
|
var simpleDnsItem = _config.SimpleDNSItem;
|
||||||
|
|
||||||
var defaultDomainResolverTag = Global.SingboxDirectDNSTag;
|
var defaultDomainResolverTag = Global.SingboxDirectDNSTag;
|
||||||
var directDNSStrategy = item.SingboxStrategy4Direct.IsNullOrEmpty() ? Global.SingboxDomainStrategy4Out.FirstOrDefault() : item.SingboxStrategy4Direct;
|
var directDnsStrategy = Global.DomainStrategy4SboxMap.GetValueOrDefault(simpleDnsItem.Strategy4Freedom);
|
||||||
|
|
||||||
var rawDNSItem = await AppManager.Instance.GetDNSItem(ECoreType.sing_box);
|
var rawDNSItem = await AppManager.Instance.GetDNSItem(ECoreType.sing_box);
|
||||||
if (rawDNSItem != null && rawDNSItem.Enabled == true)
|
if (rawDNSItem is { Enabled: true })
|
||||||
{
|
{
|
||||||
defaultDomainResolverTag = Global.SingboxLocalDNSTag;
|
defaultDomainResolverTag = Global.SingboxLocalDNSTag;
|
||||||
directDNSStrategy = rawDNSItem.DomainStrategy4Freedom.IsNullOrEmpty() ? Global.SingboxDomainStrategy4Out.FirstOrDefault() : rawDNSItem.DomainStrategy4Freedom;
|
directDnsStrategy = rawDNSItem.DomainStrategy4Freedom.IsNullOrEmpty() ? null : rawDNSItem.DomainStrategy4Freedom;
|
||||||
}
|
}
|
||||||
singboxConfig.route.default_domain_resolver = new()
|
singboxConfig.route.default_domain_resolver = new()
|
||||||
{
|
{
|
||||||
server = defaultDomainResolverTag,
|
server = defaultDomainResolverTag,
|
||||||
strategy = directDNSStrategy
|
strategy = directDnsStrategy
|
||||||
};
|
};
|
||||||
|
|
||||||
if (_config.TunModeItem.EnableTun)
|
if (_config.TunModeItem.EnableTun)
|
||||||
|
|
@ -73,18 +73,17 @@ public partial class CoreConfigSingboxService
|
||||||
|
|
||||||
var hostsDomains = new List<string>();
|
var hostsDomains = new List<string>();
|
||||||
var dnsItem = await AppManager.Instance.GetDNSItem(ECoreType.sing_box);
|
var dnsItem = await AppManager.Instance.GetDNSItem(ECoreType.sing_box);
|
||||||
if (dnsItem == null || dnsItem.Enabled == false)
|
if (dnsItem == null || !dnsItem.Enabled)
|
||||||
{
|
{
|
||||||
var simpleDNSItem = _config.SimpleDNSItem;
|
if (!simpleDnsItem.Hosts.IsNullOrEmpty())
|
||||||
if (!simpleDNSItem.Hosts.IsNullOrEmpty())
|
|
||||||
{
|
{
|
||||||
var userHostsMap = Utils.ParseHostsToDictionary(simpleDNSItem.Hosts);
|
var userHostsMap = Utils.ParseHostsToDictionary(simpleDnsItem.Hosts);
|
||||||
foreach (var kvp in userHostsMap)
|
foreach (var kvp in userHostsMap)
|
||||||
{
|
{
|
||||||
hostsDomains.Add(kvp.Key);
|
hostsDomains.Add(kvp.Key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (simpleDNSItem.UseSystemHosts == true)
|
if (simpleDnsItem.UseSystemHosts == true)
|
||||||
{
|
{
|
||||||
var systemHostsMap = Utils.GetSystemHosts();
|
var systemHostsMap = Utils.GetSystemHosts();
|
||||||
foreach (var kvp in systemHostsMap)
|
foreach (var kvp in systemHostsMap)
|
||||||
|
|
|
||||||
|
|
@ -25,25 +25,38 @@ public partial class CoreConfigV2rayService
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
var simpleDNSItem = _config.SimpleDNSItem;
|
var simpleDnsItem = _config.SimpleDNSItem;
|
||||||
var domainStrategy4Freedom = simpleDNSItem?.RayStrategy4Freedom;
|
|
||||||
|
|
||||||
|
var strategy4Freedom = simpleDnsItem?.Strategy4Freedom ?? Global.AsIs;
|
||||||
//Outbound Freedom domainStrategy
|
//Outbound Freedom domainStrategy
|
||||||
if (domainStrategy4Freedom.IsNotEmpty())
|
if (strategy4Freedom.IsNotEmpty() && strategy4Freedom != Global.AsIs)
|
||||||
{
|
{
|
||||||
var outbound = v2rayConfig.outbounds.FirstOrDefault(t => t is { protocol: "freedom", tag: Global.DirectTag });
|
var outbound = v2rayConfig.outbounds.FirstOrDefault(t => t is { protocol: "freedom", tag: Global.DirectTag });
|
||||||
if (outbound != null)
|
if (outbound != null)
|
||||||
{
|
{
|
||||||
outbound.settings = new()
|
outbound.settings = new()
|
||||||
{
|
{
|
||||||
domainStrategy = domainStrategy4Freedom,
|
domainStrategy = strategy4Freedom,
|
||||||
userLevel = 0
|
userLevel = 0
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
await GenDnsServers(node, v2rayConfig, simpleDNSItem);
|
var strategy4Proxy = simpleDnsItem?.Strategy4Proxy ?? Global.AsIs;
|
||||||
await GenDnsHosts(v2rayConfig, simpleDNSItem);
|
//Outbound Proxy domainStrategy
|
||||||
|
if (strategy4Proxy.IsNotEmpty() && strategy4Proxy != Global.AsIs)
|
||||||
|
{
|
||||||
|
var xraySupportConfigTypeNames = Global.XraySupportConfigType
|
||||||
|
.Select(x => x == EConfigType.Hysteria2 ? "hysteria" : Global.ProtocolTypes[x])
|
||||||
|
.ToHashSet();
|
||||||
|
v2rayConfig.outbounds
|
||||||
|
.Where(t => xraySupportConfigTypeNames.Contains(t.protocol))
|
||||||
|
.ToList()
|
||||||
|
.ForEach(outbound => outbound.targetStrategy = strategy4Proxy);
|
||||||
|
}
|
||||||
|
|
||||||
|
await GenDnsServers(node, v2rayConfig, simpleDnsItem);
|
||||||
|
await GenDnsHosts(v2rayConfig, simpleDnsItem);
|
||||||
|
|
||||||
if (v2rayConfig.routing.domainStrategy == Global.IPIfNonMatch)
|
if (v2rayConfig.routing.domainStrategy == Global.IPIfNonMatch)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -9,9 +9,8 @@ public class DNSSettingViewModel : MyReactiveObject
|
||||||
[Reactive] public string? DirectDNS { get; set; }
|
[Reactive] public string? DirectDNS { get; set; }
|
||||||
[Reactive] public string? RemoteDNS { get; set; }
|
[Reactive] public string? RemoteDNS { get; set; }
|
||||||
[Reactive] public string? BootstrapDNS { get; set; }
|
[Reactive] public string? BootstrapDNS { get; set; }
|
||||||
[Reactive] public string? RayStrategy4Freedom { get; set; }
|
[Reactive] public string? Strategy4Freedom { get; set; }
|
||||||
[Reactive] public string? SingboxStrategy4Direct { get; set; }
|
[Reactive] public string? Strategy4Proxy { get; set; }
|
||||||
[Reactive] public string? SingboxStrategy4Proxy { get; set; }
|
|
||||||
[Reactive] public string? Hosts { get; set; }
|
[Reactive] public string? Hosts { get; set; }
|
||||||
[Reactive] public string? DirectExpectedIPs { get; set; }
|
[Reactive] public string? DirectExpectedIPs { get; set; }
|
||||||
|
|
||||||
|
|
@ -70,9 +69,8 @@ public class DNSSettingViewModel : MyReactiveObject
|
||||||
DirectDNS = item.DirectDNS;
|
DirectDNS = item.DirectDNS;
|
||||||
RemoteDNS = item.RemoteDNS;
|
RemoteDNS = item.RemoteDNS;
|
||||||
BootstrapDNS = item.BootstrapDNS;
|
BootstrapDNS = item.BootstrapDNS;
|
||||||
RayStrategy4Freedom = item.RayStrategy4Freedom;
|
Strategy4Freedom = item.Strategy4Freedom;
|
||||||
SingboxStrategy4Direct = item.SingboxStrategy4Direct;
|
Strategy4Proxy = item.Strategy4Proxy;
|
||||||
SingboxStrategy4Proxy = item.SingboxStrategy4Proxy;
|
|
||||||
Hosts = item.Hosts;
|
Hosts = item.Hosts;
|
||||||
DirectExpectedIPs = item.DirectExpectedIPs;
|
DirectExpectedIPs = item.DirectExpectedIPs;
|
||||||
|
|
||||||
|
|
@ -100,9 +98,8 @@ public class DNSSettingViewModel : MyReactiveObject
|
||||||
_config.SimpleDNSItem.DirectDNS = DirectDNS;
|
_config.SimpleDNSItem.DirectDNS = DirectDNS;
|
||||||
_config.SimpleDNSItem.RemoteDNS = RemoteDNS;
|
_config.SimpleDNSItem.RemoteDNS = RemoteDNS;
|
||||||
_config.SimpleDNSItem.BootstrapDNS = BootstrapDNS;
|
_config.SimpleDNSItem.BootstrapDNS = BootstrapDNS;
|
||||||
_config.SimpleDNSItem.RayStrategy4Freedom = RayStrategy4Freedom;
|
_config.SimpleDNSItem.Strategy4Freedom = Strategy4Freedom;
|
||||||
_config.SimpleDNSItem.SingboxStrategy4Direct = SingboxStrategy4Direct;
|
_config.SimpleDNSItem.Strategy4Proxy = Strategy4Proxy;
|
||||||
_config.SimpleDNSItem.SingboxStrategy4Proxy = SingboxStrategy4Proxy;
|
|
||||||
_config.SimpleDNSItem.Hosts = Hosts;
|
_config.SimpleDNSItem.Hosts = Hosts;
|
||||||
_config.SimpleDNSItem.DirectExpectedIPs = DirectExpectedIPs;
|
_config.SimpleDNSItem.DirectExpectedIPs = DirectExpectedIPs;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -105,28 +105,14 @@
|
||||||
Text="{x:Static resx:ResUI.TbBootstrapDNSTips}"
|
Text="{x:Static resx:ResUI.TbBootstrapDNSTips}"
|
||||||
TextWrapping="Wrap" />
|
TextWrapping="Wrap" />
|
||||||
|
|
||||||
<TextBlock
|
|
||||||
Grid.Row="4"
|
|
||||||
Grid.Column="0"
|
|
||||||
Margin="{StaticResource Margin4}"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Text="{x:Static resx:ResUI.TbXrayFreedomStrategy}" />
|
|
||||||
<ComboBox
|
|
||||||
x:Name="cmbRayFreedomDNSStrategy"
|
|
||||||
Grid.Row="4"
|
|
||||||
Grid.Column="1"
|
|
||||||
Width="200"
|
|
||||||
Margin="{StaticResource Margin4}"
|
|
||||||
PlaceholderText="Default" />
|
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="5"
|
Grid.Row="5"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Margin="{StaticResource Margin4}"
|
Margin="{StaticResource Margin4}"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Text="{x:Static resx:ResUI.TbSBDirectResolveStrategy}" />
|
Text="{x:Static resx:ResUI.TbDirectResolveStrategy}" />
|
||||||
<ComboBox
|
<ComboBox
|
||||||
x:Name="cmbSBDirectDNSStrategy"
|
x:Name="cmbDirectDNSStrategy"
|
||||||
Grid.Row="5"
|
Grid.Row="5"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Width="200"
|
Width="200"
|
||||||
|
|
@ -138,9 +124,9 @@
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Margin="{StaticResource Margin4}"
|
Margin="{StaticResource Margin4}"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Text="{x:Static resx:ResUI.TbSBRemoteResolveStrategy}" />
|
Text="{x:Static resx:ResUI.TbRemoteResolveStrategy}" />
|
||||||
<ComboBox
|
<ComboBox
|
||||||
x:Name="cmbSBRemoteDNSStrategy"
|
x:Name="cmbRemoteDNSStrategy"
|
||||||
Grid.Row="6"
|
Grid.Row="6"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Width="200"
|
Width="200"
|
||||||
|
|
|
||||||
|
|
@ -15,16 +15,15 @@ public partial class DNSSettingWindow : WindowBase<DNSSettingViewModel>
|
||||||
btnCancel.Click += (s, e) => Close();
|
btnCancel.Click += (s, e) => Close();
|
||||||
ViewModel = new DNSSettingViewModel(UpdateViewHandler);
|
ViewModel = new DNSSettingViewModel(UpdateViewHandler);
|
||||||
|
|
||||||
cmbRayFreedomDNSStrategy.ItemsSource = Global.DomainStrategy4Freedoms;
|
cmbDirectDNSStrategy.ItemsSource = Global.DomainStrategy;
|
||||||
cmbSBDirectDNSStrategy.ItemsSource = Global.SingboxDomainStrategy4Out;
|
cmbRemoteDNSStrategy.ItemsSource = Global.DomainStrategy;
|
||||||
cmbSBRemoteDNSStrategy.ItemsSource = Global.SingboxDomainStrategy4Out;
|
|
||||||
cmbDirectDNS.ItemsSource = Global.DomainDirectDNSAddress;
|
cmbDirectDNS.ItemsSource = Global.DomainDirectDNSAddress;
|
||||||
cmbRemoteDNS.ItemsSource = Global.DomainRemoteDNSAddress;
|
cmbRemoteDNS.ItemsSource = Global.DomainRemoteDNSAddress;
|
||||||
cmbBootstrapDNS.ItemsSource = Global.DomainPureIPDNSAddress;
|
cmbBootstrapDNS.ItemsSource = Global.DomainPureIPDNSAddress;
|
||||||
cmbDirectExpectedIPs.ItemsSource = Global.ExpectedIPs;
|
cmbDirectExpectedIPs.ItemsSource = Global.ExpectedIPs;
|
||||||
|
|
||||||
cmbdomainStrategy4FreedomCompatible.ItemsSource = Global.DomainStrategy4Freedoms;
|
cmbdomainStrategy4FreedomCompatible.ItemsSource = Global.DomainStrategy;
|
||||||
cmbdomainStrategy4OutCompatible.ItemsSource = Global.SingboxDomainStrategy4Out;
|
cmbdomainStrategy4OutCompatible.ItemsSource = Global.DomainStrategies4Sbox;
|
||||||
cmbdomainDNSAddressCompatible.ItemsSource = Global.DomainPureIPDNSAddress;
|
cmbdomainDNSAddressCompatible.ItemsSource = Global.DomainPureIPDNSAddress;
|
||||||
cmbdomainDNSAddress2Compatible.ItemsSource = Global.DomainPureIPDNSAddress;
|
cmbdomainDNSAddress2Compatible.ItemsSource = Global.DomainPureIPDNSAddress;
|
||||||
|
|
||||||
|
|
@ -37,9 +36,8 @@ public partial class DNSSettingWindow : WindowBase<DNSSettingViewModel>
|
||||||
this.Bind(ViewModel, vm => vm.DirectDNS, v => v.cmbDirectDNS.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.DirectDNS, v => v.cmbDirectDNS.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.RemoteDNS, v => v.cmbRemoteDNS.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.RemoteDNS, v => v.cmbRemoteDNS.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.BootstrapDNS, v => v.cmbBootstrapDNS.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.BootstrapDNS, v => v.cmbBootstrapDNS.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.RayStrategy4Freedom, v => v.cmbRayFreedomDNSStrategy.SelectedItem).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.Strategy4Freedom, v => v.cmbDirectDNSStrategy.SelectedItem).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.SingboxStrategy4Direct, v => v.cmbSBDirectDNSStrategy.SelectedItem).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.Strategy4Proxy, v => v.cmbRemoteDNSStrategy.SelectedItem).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.SingboxStrategy4Proxy, v => v.cmbSBRemoteDNSStrategy.SelectedItem).DisposeWith(disposables);
|
|
||||||
this.Bind(ViewModel, vm => vm.Hosts, v => v.txtHosts.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.Hosts, v => v.txtHosts.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.DirectExpectedIPs, v => v.cmbDirectExpectedIPs.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.DirectExpectedIPs, v => v.cmbDirectExpectedIPs.Text).DisposeWith(disposables);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ public partial class RoutingRuleSettingWindow : WindowBase<RoutingRuleSettingVie
|
||||||
ViewModel = new RoutingRuleSettingViewModel(routingItem, UpdateViewHandler);
|
ViewModel = new RoutingRuleSettingViewModel(routingItem, UpdateViewHandler);
|
||||||
|
|
||||||
cmbdomainStrategy.ItemsSource = Global.DomainStrategies.AppendEmpty();
|
cmbdomainStrategy.ItemsSource = Global.DomainStrategies.AppendEmpty();
|
||||||
cmbdomainStrategy4Singbox.ItemsSource = Global.DomainStrategies4Singbox;
|
cmbdomainStrategy4Singbox.ItemsSource = Global.DomainStrategies4Sbox;
|
||||||
|
|
||||||
this.WhenActivated(disposables =>
|
this.WhenActivated(disposables =>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ public partial class RoutingSettingWindow : WindowBase<RoutingSettingViewModel>
|
||||||
ViewModel = new RoutingSettingViewModel(UpdateViewHandler);
|
ViewModel = new RoutingSettingViewModel(UpdateViewHandler);
|
||||||
|
|
||||||
cmbdomainStrategy.ItemsSource = Global.DomainStrategies;
|
cmbdomainStrategy.ItemsSource = Global.DomainStrategies;
|
||||||
cmbdomainStrategy4Singbox.ItemsSource = Global.DomainStrategies4Singbox;
|
cmbdomainStrategy4Singbox.ItemsSource = Global.DomainStrategies4Sbox;
|
||||||
|
|
||||||
this.WhenActivated(disposables =>
|
this.WhenActivated(disposables =>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -133,31 +133,15 @@
|
||||||
Text="{x:Static resx:ResUI.TbBootstrapDNSTips}"
|
Text="{x:Static resx:ResUI.TbBootstrapDNSTips}"
|
||||||
TextWrapping="Wrap" />
|
TextWrapping="Wrap" />
|
||||||
|
|
||||||
<TextBlock
|
|
||||||
Grid.Row="4"
|
|
||||||
Grid.Column="0"
|
|
||||||
Margin="{StaticResource Margin8}"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Style="{StaticResource ToolbarTextBlock}"
|
|
||||||
Text="{x:Static resx:ResUI.TbXrayFreedomStrategy}" />
|
|
||||||
<ComboBox
|
|
||||||
x:Name="cmbRayFreedomDNSStrategy"
|
|
||||||
Grid.Row="4"
|
|
||||||
Grid.Column="1"
|
|
||||||
Width="200"
|
|
||||||
Margin="{StaticResource Margin8}"
|
|
||||||
materialDesign:HintAssist.Hint="Default"
|
|
||||||
Style="{StaticResource DefComboBox}" />
|
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="5"
|
Grid.Row="5"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Margin="{StaticResource Margin8}"
|
Margin="{StaticResource Margin8}"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Style="{StaticResource ToolbarTextBlock}"
|
Style="{StaticResource ToolbarTextBlock}"
|
||||||
Text="{x:Static resx:ResUI.TbSBDirectResolveStrategy}" />
|
Text="{x:Static resx:ResUI.TbDirectResolveStrategy}" />
|
||||||
<ComboBox
|
<ComboBox
|
||||||
x:Name="cmbSBDirectDNSStrategy"
|
x:Name="cmbDirectDNSStrategy"
|
||||||
Grid.Row="5"
|
Grid.Row="5"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Width="200"
|
Width="200"
|
||||||
|
|
@ -171,9 +155,9 @@
|
||||||
Margin="{StaticResource Margin8}"
|
Margin="{StaticResource Margin8}"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Style="{StaticResource ToolbarTextBlock}"
|
Style="{StaticResource ToolbarTextBlock}"
|
||||||
Text="{x:Static resx:ResUI.TbSBRemoteResolveStrategy}" />
|
Text="{x:Static resx:ResUI.TbRemoteResolveStrategy}" />
|
||||||
<ComboBox
|
<ComboBox
|
||||||
x:Name="cmbSBRemoteDNSStrategy"
|
x:Name="cmbRemoteDNSStrategy"
|
||||||
Grid.Row="6"
|
Grid.Row="6"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Width="200"
|
Width="200"
|
||||||
|
|
|
||||||
|
|
@ -13,16 +13,15 @@ public partial class DNSSettingWindow
|
||||||
|
|
||||||
ViewModel = new DNSSettingViewModel(UpdateViewHandler);
|
ViewModel = new DNSSettingViewModel(UpdateViewHandler);
|
||||||
|
|
||||||
cmbRayFreedomDNSStrategy.ItemsSource = Global.DomainStrategy4Freedoms;
|
cmbDirectDNSStrategy.ItemsSource = Global.DomainStrategy;
|
||||||
cmbSBDirectDNSStrategy.ItemsSource = Global.SingboxDomainStrategy4Out;
|
cmbRemoteDNSStrategy.ItemsSource = Global.DomainStrategy;
|
||||||
cmbSBRemoteDNSStrategy.ItemsSource = Global.SingboxDomainStrategy4Out;
|
|
||||||
cmbDirectDNS.ItemsSource = Global.DomainDirectDNSAddress;
|
cmbDirectDNS.ItemsSource = Global.DomainDirectDNSAddress;
|
||||||
cmbRemoteDNS.ItemsSource = Global.DomainRemoteDNSAddress;
|
cmbRemoteDNS.ItemsSource = Global.DomainRemoteDNSAddress;
|
||||||
cmbBootstrapDNS.ItemsSource = Global.DomainPureIPDNSAddress;
|
cmbBootstrapDNS.ItemsSource = Global.DomainPureIPDNSAddress;
|
||||||
cmbDirectExpectedIPs.ItemsSource = Global.ExpectedIPs;
|
cmbDirectExpectedIPs.ItemsSource = Global.ExpectedIPs;
|
||||||
|
|
||||||
cmbdomainStrategy4FreedomCompatible.ItemsSource = Global.DomainStrategy4Freedoms;
|
cmbdomainStrategy4FreedomCompatible.ItemsSource = Global.DomainStrategy;
|
||||||
cmbdomainStrategy4OutCompatible.ItemsSource = Global.SingboxDomainStrategy4Out;
|
cmbdomainStrategy4OutCompatible.ItemsSource = Global.DomainStrategies4Sbox;
|
||||||
cmbdomainDNSAddressCompatible.ItemsSource = Global.DomainPureIPDNSAddress;
|
cmbdomainDNSAddressCompatible.ItemsSource = Global.DomainPureIPDNSAddress;
|
||||||
cmbdomainDNSAddress2Compatible.ItemsSource = Global.DomainPureIPDNSAddress;
|
cmbdomainDNSAddress2Compatible.ItemsSource = Global.DomainPureIPDNSAddress;
|
||||||
|
|
||||||
|
|
@ -35,9 +34,8 @@ public partial class DNSSettingWindow
|
||||||
this.Bind(ViewModel, vm => vm.DirectDNS, v => v.cmbDirectDNS.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.DirectDNS, v => v.cmbDirectDNS.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.RemoteDNS, v => v.cmbRemoteDNS.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.RemoteDNS, v => v.cmbRemoteDNS.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.BootstrapDNS, v => v.cmbBootstrapDNS.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.BootstrapDNS, v => v.cmbBootstrapDNS.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.RayStrategy4Freedom, v => v.cmbRayFreedomDNSStrategy.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.Strategy4Freedom, v => v.cmbDirectDNSStrategy.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.SingboxStrategy4Direct, v => v.cmbSBDirectDNSStrategy.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.Strategy4Proxy, v => v.cmbRemoteDNSStrategy.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.SingboxStrategy4Proxy, v => v.cmbSBRemoteDNSStrategy.Text).DisposeWith(disposables);
|
|
||||||
this.Bind(ViewModel, vm => vm.Hosts, v => v.txtHosts.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.Hosts, v => v.txtHosts.Text).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.DirectExpectedIPs, v => v.cmbDirectExpectedIPs.Text).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.DirectExpectedIPs, v => v.cmbDirectExpectedIPs.Text).DisposeWith(disposables);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ public partial class RoutingRuleSettingWindow
|
||||||
ViewModel = new RoutingRuleSettingViewModel(routingItem, UpdateViewHandler);
|
ViewModel = new RoutingRuleSettingViewModel(routingItem, UpdateViewHandler);
|
||||||
|
|
||||||
cmbdomainStrategy.ItemsSource = Global.DomainStrategies.AppendEmpty();
|
cmbdomainStrategy.ItemsSource = Global.DomainStrategies.AppendEmpty();
|
||||||
cmbdomainStrategy4Singbox.ItemsSource = Global.DomainStrategies4Singbox;
|
cmbdomainStrategy4Singbox.ItemsSource = Global.DomainStrategies4Sbox;
|
||||||
|
|
||||||
this.WhenActivated(disposables =>
|
this.WhenActivated(disposables =>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ public partial class RoutingSettingWindow
|
||||||
ViewModel = new RoutingSettingViewModel(UpdateViewHandler);
|
ViewModel = new RoutingSettingViewModel(UpdateViewHandler);
|
||||||
|
|
||||||
cmbdomainStrategy.ItemsSource = Global.DomainStrategies;
|
cmbdomainStrategy.ItemsSource = Global.DomainStrategies;
|
||||||
cmbdomainStrategy4Singbox.ItemsSource = Global.DomainStrategies4Singbox;
|
cmbdomainStrategy4Singbox.ItemsSource = Global.DomainStrategies4Sbox;
|
||||||
|
|
||||||
this.WhenActivated(disposables =>
|
this.WhenActivated(disposables =>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue