Adds properties

This commit is contained in:
DHR60 2025-08-14 09:53:39 +08:00
parent f45290eb3a
commit 7b082cf870
2 changed files with 19 additions and 3 deletions

View file

@ -203,8 +203,15 @@ public class Response4Ray
public class Dns4Ray
{
public Dictionary<string, List<string>>? hosts { get; set; }
public Dictionary<string, object>? hosts { get; set; }
public List<object> servers { get; set; }
public string? clientIp { get; set; }
public string? queryStrategy { get; set; }
public bool? disableCache { get; set; }
public bool? disableFallback { get; set; }
public bool? disableFallbackIfMatch { get; set; }
public bool? useSystemHosts { get; set; }
public string? tag { get; set; }
}
public class DnsServer4Ray
@ -214,6 +221,12 @@ public class DnsServer4Ray
public bool? skipFallback { get; set; }
public List<string>? expectedIPs { get; set; }
public List<string>? unexpectedIPs { get; set; }
public string? clientIp { get; set; }
public string? queryStrategy { get; set; }
public int? timeoutMs { get; set; }
public bool? disableCache { get; set; }
public bool? finalQuery { get; set; }
public string? tag { get; set; }
}
public class Routing4Ray

View file

@ -1340,10 +1340,13 @@ public class CoreConfigV2rayService
return await Task.FromResult(0);
}
v2rayConfig.dns ??= new Dns4Ray();
v2rayConfig.dns.hosts ??= new Dictionary<string, List<string>>();
v2rayConfig.dns.hosts ??= new Dictionary<string, object>();
if (simpleDNSItem.AddCommonHosts == true)
{
v2rayConfig.dns.hosts = Global.PredefinedHosts;
v2rayConfig.dns.hosts = Global.PredefinedHosts.ToDictionary(
kvp => kvp.Key,
kvp => (object)kvp.Value
);
}
if (simpleDNSItem.UseSystemHosts == true)