diff --git a/FastGithub.DomainResolve/DnscryptProxy.cs b/FastGithub.DomainResolve/DnscryptProxy.cs index 6cf2cd3..98afa7f 100644 --- a/FastGithub.DomainResolve/DnscryptProxy.cs +++ b/FastGithub.DomainResolve/DnscryptProxy.cs @@ -79,7 +79,8 @@ namespace FastGithub.DomainResolve var localEndPoint = new IPEndPoint(IPAddress.Loopback, port); await TomlUtil.SetListensAsync(this.tomlFilePath, localEndPoint, cancellationToken); - await TomlUtil.SetlogLevelAsync(this.tomlFilePath, 6, cancellationToken); + await TomlUtil.SetLogLevelAsync(this.tomlFilePath, 6, cancellationToken); + await TomlUtil.SetLBStrategyAsync(this.tomlFilePath, "ph", cancellationToken); await TomlUtil.SetMinMaxTTLAsync(this.tomlFilePath, TimeSpan.FromMinutes(1d), TimeSpan.FromMinutes(2d), cancellationToken); if (OperatingSystem.IsWindows() && Environment.UserInteractive == false) diff --git a/FastGithub.DomainResolve/TomlUtil.cs b/FastGithub.DomainResolve/TomlUtil.cs index 4ec35f6..5228f7a 100644 --- a/FastGithub.DomainResolve/TomlUtil.cs +++ b/FastGithub.DomainResolve/TomlUtil.cs @@ -36,11 +36,23 @@ namespace FastGithub.DomainResolve /// /// /// - public static Task SetlogLevelAsync(string tomlPath, int logLevel, CancellationToken cancellationToken) + public static Task SetLogLevelAsync(string tomlPath, int logLevel, CancellationToken cancellationToken) { return SetAsync(tomlPath, "log_level", new TomlInteger { Value = logLevel }, cancellationToken); } + /// + /// 设置负载均衡模式 + /// + /// + /// + /// + /// + public static Task SetLBStrategyAsync(string tomlPath, string value, CancellationToken cancellationToken) + { + return SetAsync(tomlPath, "lb_strategy", new TomlString { Value = value }, cancellationToken); + } + /// /// 设置TTL /// @@ -59,7 +71,7 @@ namespace FastGithub.DomainResolve await SetAsync(tomlPath, "cache_max_ttl", maxValue, cancellationToken); await SetAsync(tomlPath, "cache_neg_max_ttl", maxValue, cancellationToken); } - + /// /// 设置指定键的值 ///