mirror of
https://github.com/netchx/netch.git
synced 2026-03-14 17:43:18 +08:00
[Netch] WTF
This commit is contained in:
@@ -3,9 +3,33 @@
|
||||
public class ProcessMode
|
||||
{
|
||||
/// <summary>
|
||||
/// DNS
|
||||
/// 伪造 ICMP 延迟
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("dns")]
|
||||
public string DNS = "1.1.1.1:53";
|
||||
[Newtonsoft.Json.JsonProperty("icmping")]
|
||||
public int Icmping = 1;
|
||||
|
||||
/// <summary>
|
||||
/// 仅劫持规则内进程
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("dnsOnly")]
|
||||
public bool DNSOnly = false;
|
||||
|
||||
/// <summary>
|
||||
/// 远程 DNS 查询
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("dnsProx")]
|
||||
public bool DNSProx = true;
|
||||
|
||||
/// <summary>
|
||||
/// DNS 地址
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("dnsHost")]
|
||||
public string DNSHost = "1.1.1.1";
|
||||
|
||||
/// <summary>
|
||||
/// DNS 端口
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("dnsPort")]
|
||||
public ushort DNSPort = 53;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,6 +39,12 @@ namespace Netch.Models.Mode.ProcessMode
|
||||
[Newtonsoft.Json.JsonProperty("filterUDP")]
|
||||
public bool UDP = true;
|
||||
|
||||
/// <summary>
|
||||
/// 过滤 DNS 流量
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("filterDNS")]
|
||||
public bool DNS = true;
|
||||
|
||||
/// <summary>
|
||||
/// 绕过列表
|
||||
/// </summary>
|
||||
|
||||
@@ -45,7 +45,16 @@ namespace Netch.Models.Server
|
||||
/// 解析地址
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string Resolve() => (Utils.DNS.Fetch(this.Host) != IPAddress.Any) ? Utils.DNS.Fetch(this.Host).ToString() : this.Host;
|
||||
public string Resolve()
|
||||
{
|
||||
var addr = Utils.DNS.Fetch(this.Host);
|
||||
while (addr == IPAddress.Any)
|
||||
{
|
||||
addr = Utils.DNS.Fetch(this.Host);
|
||||
}
|
||||
|
||||
return addr.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取备注
|
||||
|
||||
Reference in New Issue
Block a user