Skip to content

Commit

Permalink
🐛 修复默认doh地址导致加速失效的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
rmbadmin committed Sep 23, 2024
1 parent f1ffae1 commit 71f104b
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion build/settings_v4_app.json
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,7 @@
},
{
"TypeName": "string",
"PropertyName": "CustomDohAddres",
"PropertyName": "CustomDohAddres2",
"DefaultValue": "null",
"DefaultValueIsConst": true,
"Summary": "自定义 DNS over HTTPS 地址",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public DnsDohAnalysisService(
{
}

public const string DefaultDohAddres = Dnspod_DohAddres;
public const string DefaultDohAddres = Dnspod_DohAddres2;

static Uri GetDohAddres(string? dohAddres)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ async Task<OperateProxyServiceResult> StartProxyServiceCoreAsync()
string? proxyDNS = ProxySettings.ProxyMasterDns.Value;
bool isSupportIpv6 = await RefreshIpv6Support();
bool useDoh = ProxySettings.UseDoh.Value;
string? customDohAddres = ProxySettings.CustomDohAddres.Value;
string? customDohAddres = ProxySettings.CustomDohAddres2.Value;

Lazy<IPAddress> proxyIp_ = new(() => ReverseProxySettings.GetProxyIp(proxyIp));
void SetProxyIp(IPAddress proxyIPAddress)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ static IProxySettings? Instance
/// <summary>
/// 自定义 DNS over HTTPS 地址
/// </summary>
string? CustomDohAddres { get; set; }
string? CustomDohAddres2 { get; set; }

/// <summary>
/// 加速页面 Tab 选项卡选中下标
Expand Down Expand Up @@ -278,7 +278,7 @@ static IProxySettings? Instance
/// <summary>
/// 自定义 DNS over HTTPS 地址的默认值
/// </summary>
const string? DefaultCustomDohAddres = null;
const string? DefaultCustomDohAddres2 = null;

/// <summary>
/// 加速页面 Tab 选项卡选中下标的默认值
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ static JsonTypeInfo<ProxySettings_> ISettings<ProxySettings_>.JsonTypeInfo
/// 自定义 DNS over HTTPS 地址
/// </summary>
[MPKey(22), MP2Key(22), JsonPropertyOrder(22)]
public string? CustomDohAddres { get; set; } = IProxySettings.DefaultCustomDohAddres;
public string? CustomDohAddres2 { get; set; } = IProxySettings.DefaultCustomDohAddres2;

/// <summary>
/// 加速页面 Tab 选项卡选中下标
Expand Down Expand Up @@ -368,8 +368,8 @@ public static partial class ProxySettings
/// <summary>
/// 自定义 DNS over HTTPS 地址
/// </summary>
public static SettingsProperty<string, ProxySettings_> CustomDohAddres { get; }
= new(DefaultCustomDohAddres);
public static SettingsProperty<string, ProxySettings_> CustomDohAddres2 { get; }
= new(DefaultCustomDohAddres2);

/// <summary>
/// 加速页面 Tab 选项卡选中下标
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public AcceleratorPageViewModel()
IPAddress[] address;
if (ProxySettings.UseDoh)
{
var configDoh = ProxySettings.CustomDohAddres.Value ?? ProxySettingsWindowViewModel.DohAddress.FirstOrDefault() ?? string.Empty;
var configDoh = ProxySettings.CustomDohAddres2.Value ?? ProxySettingsWindowViewModel.DohAddress.FirstOrDefault() ?? string.Empty;
(delayMs, address) = await networkTestService.TestDNSOverHttpsAsync(testDomain, configDoh);
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@
IsEnabled="{Binding Source={x:Static ms:ProxySettings.UseDoh}, Path=Value}"
ItemsSource="{Binding Source={x:Static spp:ProxySettingsWindowViewModel.DohAddress}}"
PlaceholderText="{Binding Source={x:Static s:IDnsAnalysisService.Dnspod_DohAddres}, Mode=OneWay}"
Text="{Binding Source={x:Static ms:ProxySettings.CustomDohAddres}, Path=Value, Mode=TwoWay}" />
Text="{Binding Source={x:Static ms:ProxySettings.CustomDohAddres2}, Path=Value, Mode=TwoWay}" />
</ui:SettingsExpanderItem.Footer>
</ui:SettingsExpanderItem>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
IsEnabled="{Binding Source={x:Static ms:ProxySettings.UseDoh}, Path=Value}"
ItemsSource="{Binding DohAddress}"
PlaceholderText="{Binding Source={x:Static s:IDnsAnalysisService.Dnspod_DohAddres}, Mode=OneWay}"
Text="{Binding Source={x:Static ms:ProxySettings.CustomDohAddres}, Path=Value, Mode=TwoWay}" />
Text="{Binding Source={x:Static ms:ProxySettings.CustomDohAddres2}, Path=Value, Mode=TwoWay}" />
</ui:SettingsExpanderItem.Footer>
</ui:SettingsExpanderItem>

Expand Down

0 comments on commit 71f104b

Please sign in to comment.