日志格式
This commit is contained in:
parent
7d7b67948b
commit
844ab4d24a
@ -56,7 +56,7 @@ namespace FastGithub.DomainResolve
|
||||
{
|
||||
if (this.dnsEndPointAddressElapseds.TryGetValue(endPoint, out var addressElapseds) && addressElapseds.IsEmpty == false)
|
||||
{
|
||||
this.logger.LogInformation($"{endPoint.Host}: {addressElapseds}");
|
||||
this.logger.LogInformation($"{endPoint.Host}->{addressElapseds}");
|
||||
foreach (var addressElapsed in addressElapseds)
|
||||
{
|
||||
yield return addressElapsed.Adddress;
|
||||
@ -67,6 +67,7 @@ namespace FastGithub.DomainResolve
|
||||
this.dnsEndPointAddressElapseds.TryAdd(endPoint, IPAddressElapsedCollection.Empty);
|
||||
await foreach (var adddress in this.dnsClient.ResolveAsync(endPoint, cancellationToken))
|
||||
{
|
||||
this.logger.LogInformation($"{endPoint.Host}->{adddress}");
|
||||
yield return adddress;
|
||||
}
|
||||
}
|
||||
|
||||
@ -79,7 +79,7 @@ namespace FastGithub.DomainResolve
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"[{string.Join(',', this.addressElapseds.Select(item => item.Adddress))}]";
|
||||
return $"[{string.Join(", ", this.addressElapseds.Select(item => item.Adddress))}]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -146,6 +146,11 @@ namespace FastGithub.PacketIntercept.Dns
|
||||
{
|
||||
var record = new IPAddressResourceRecord(domain, IPAddress.Loopback, this.ttl);
|
||||
response.AnswerRecords.Add(record);
|
||||
this.logger.LogInformation($"{domain}->{IPAddress.Loopback}");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.logger.LogInformation($"{domain}->NULL");
|
||||
}
|
||||
var responsePayload = response.ToArray();
|
||||
|
||||
@ -182,7 +187,6 @@ namespace FastGithub.PacketIntercept.Dns
|
||||
: WinDivertDirection.Inbound;
|
||||
|
||||
WinDivert.WinDivertHelperCalcChecksums(winDivertBuffer, packetLength, ref winDivertAddress, WinDivertChecksumHelperParam.All);
|
||||
this.logger.LogInformation($"已拦截向dns://{destAddress}:{destPort}查询{domain}");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -4,8 +4,7 @@
|
||||
"HttpProxyPort": 38457, // http代理端口,linux/osx平台使用
|
||||
"FallbackDns": [ // 以下dns必须要支持tcp
|
||||
"114.114.114.114:53",
|
||||
"119.29.29.29:53",
|
||||
"208.67.222.222:53"
|
||||
"119.29.29.29:53"
|
||||
],
|
||||
"DomainConfigs": {
|
||||
"*.fastgithub.com": { // 域名的*表示除.之外0到多个任意字符
|
||||
|
||||
Loading…
Reference in New Issue
Block a user