From efae85db2cafff94ebd175b25bcae51a5e7f23bc Mon Sep 17 00:00:00 2001 From: Aigio Liu Date: Sun, 24 Jul 2022 13:41:29 +0800 Subject: [PATCH] Add UseWinHttpHandler --- Directory.Packages.props | 1 + .../PlatformHttpMessageHandlerBuilder.cs | 4 +- .../Pages/Settings/Settings_General.axaml | 12 ++ .../ST.Client.Windows.csproj | 1 + .../ArchiSteamFarmServiceImpl.cs | 2 +- .../Settings/GeneralSettings.Avalonia.cs | 10 ++ .../UI/Resx/AppResources.Designer.cs | 9 ++ src/ST.Client/UI/Resx/AppResources.resx | 3 + .../ServiceCollectionExtensions.cs | 1 + src/Startup.cs | 145 +++++++++++++++--- 10 files changed, 164 insertions(+), 24 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 10c4abbf7..541c00886 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -84,6 +84,7 @@ + diff --git a/src/ST.Client.Android/Services/Implementation/PlatformHttpMessageHandlerBuilder.cs b/src/ST.Client.Android/Services/Implementation/PlatformHttpMessageHandlerBuilder.cs index a4b7c08d3..4cdbc9467 100644 --- a/src/ST.Client.Android/Services/Implementation/PlatformHttpMessageHandlerBuilder.cs +++ b/src/ST.Client.Android/Services/Implementation/PlatformHttpMessageHandlerBuilder.cs @@ -14,10 +14,10 @@ namespace System.Application.Services.Implementation #endif } - public static AndroidClientHandler CreateAndroidClientHandler() + public static AndroidClientHandler CreateAndroidClientHandler(AndroidClientHandler? handler = null) { // https://docs.microsoft.com/zh-cn/xamarin/android/app-fundamentals/http-stack?context=xamarin%2Fcross-platform&tabs=macos - var handler = new AndroidClientHandler(); + handler ??= new AndroidClientHandler(); AddFiddlerRootCertificate(handler); GeneralHttpClientFactory.SetProxyToHandler(GeneralHttpClientFactory.DefaultProxy, handler); return handler; diff --git a/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Pages/Settings/Settings_General.axaml b/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Pages/Settings/Settings_General.axaml index 5e36e3fb5..5de51b32f 100644 --- a/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Pages/Settings/Settings_General.axaml +++ b/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Pages/Settings/Settings_General.axaml @@ -69,6 +69,18 @@ + + + + + + + + + + +