修改默认配置
This commit is contained in:
parent
cfeb5b2404
commit
9dfbaea1c5
@ -14,13 +14,13 @@ namespace FastGithub.Dns
|
||||
/// <summary>
|
||||
/// dns后台服务
|
||||
/// </summary>
|
||||
sealed class DnsHostedService : BackgroundService
|
||||
sealed class DnsServerHostedService : BackgroundService
|
||||
{
|
||||
private const int SIO_UDP_CONNRESET = unchecked((int)0x9800000C);
|
||||
|
||||
private readonly IRequestResolver requestResolver;
|
||||
private readonly IOptions<DnsOptions> options;
|
||||
private readonly ILogger<DnsHostedService> logger;
|
||||
private readonly ILogger<DnsServerHostedService> logger;
|
||||
|
||||
private readonly Socket socket = new(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
|
||||
private readonly byte[] buffer = new byte[ushort.MaxValue];
|
||||
@ -33,10 +33,10 @@ namespace FastGithub.Dns
|
||||
/// <param name="githubRequestResolver"></param>
|
||||
/// <param name="options"></param>
|
||||
/// <param name="logger"></param>
|
||||
public DnsHostedService(
|
||||
public DnsServerHostedService(
|
||||
GithubRequestResolver githubRequestResolver,
|
||||
IOptions<DnsOptions> options,
|
||||
ILogger<DnsHostedService> logger)
|
||||
ILogger<DnsServerHostedService> logger)
|
||||
{
|
||||
this.options = options;
|
||||
this.logger = logger;
|
||||
@ -20,7 +20,7 @@ namespace FastGithub
|
||||
var assembly = typeof(DnsServiceCollectionExtensions).Assembly;
|
||||
return services
|
||||
.AddServiceAndOptions(assembly, configuration)
|
||||
.AddHostedService<DnsHostedService>();
|
||||
.AddHostedService<DnsServerHostedService>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
{
|
||||
"Dns": {
|
||||
"UpStream": "114.114.114.114", // 上游dns
|
||||
"GithubTTL": "00:10:00", // github相关域名解析结果的存活时长
|
||||
"GithubTTL": "00:05:00", // github相关域名解析结果的存活时长
|
||||
"SetToLocalMachine": true, // 是否设置本机使用此dns(仅支持windows)
|
||||
"UseGithubReverseProxy": true // 是否使用反向代理访问github以解决连接被重复的问题
|
||||
},
|
||||
@ -15,7 +15,7 @@
|
||||
},
|
||||
"PublicDnsProvider": {
|
||||
"Enable": true, // 是否需要从dns服务器查找ip
|
||||
"Timeout": "00:00:00.100", // dns查询超时时长
|
||||
"Timeout": "00:00:00.200", // dns查询超时时长
|
||||
"Dnss": [ // dns服务器列表
|
||||
"1.2.4.8",
|
||||
"8.8.8.8",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user