diff --git a/NebulaAuth/App.xaml b/NebulaAuth/App.xaml index cd88f9d..072c7f1 100644 --- a/NebulaAuth/App.xaml +++ b/NebulaAuth/App.xaml @@ -8,9 +8,6 @@ StartupUri="MainWindow.xaml"> - #1E2025 - pack://application:,,,/Fonts/Roboto/#Roboto - pack://application:,,,/Fonts/Roboto/#Roboto Symbols @@ -19,27 +16,74 @@ + + + + + True False - + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/NebulaAuth/Converters/NullableToBooleanConverter.cs b/NebulaAuth/Converters/NullableToBooleanConverter.cs new file mode 100644 index 0000000..4ac91fc --- /dev/null +++ b/NebulaAuth/Converters/NullableToBooleanConverter.cs @@ -0,0 +1,19 @@ +using System.Globalization; +using System.Windows.Data; +using System; + +namespace NebulaAuth.Converters; + +public class NullableToBooleanConverter : IValueConverter +{ + public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture) + { + return value != null; + + } + + public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) + { + throw new NotSupportedException(); + } +} diff --git a/NebulaAuth/Core/ThemeManager.cs b/NebulaAuth/Core/ThemeManager.cs index ffbe285..9a248fd 100644 --- a/NebulaAuth/Core/ThemeManager.cs +++ b/NebulaAuth/Core/ThemeManager.cs @@ -2,6 +2,7 @@ using System; using System.ComponentModel; using System.Drawing; +using System.Linq; using System.Windows; using System.Windows.Interop; using System.Windows.Media; @@ -58,10 +59,26 @@ public static class ThemeManager private static void UpdateBackground() { var color = Settings.Instance.BackgroundColor ?? DefaultBackgroundColor; - Application.Current.Resources["WindowBackground"] = new SolidColorBrush(color); - + Application.Current.Resources["Background"] = color; + ApplyTheme(); } + private static void ApplyTheme() + { + var keysToGenerate = Application.Current.Resources.Keys + .OfType() + .Where(k => Application.Current.Resources[k] is System.Windows.Media.Color); + + foreach (var key in keysToGenerate) + { + string brushKey = key + "Brush"; // Генерируем имя для Brush + var color = (System.Windows.Media.Color)Application.Current.Resources[key]; + Application.Current.Resources[brushKey] = new SolidColorBrush(color); + } + } + + + public static void InitializeTheme() { UpdateIcon(); diff --git a/NebulaAuth/MainWindow.xaml b/NebulaAuth/MainWindow.xaml index fbe2140..24de13a 100644 --- a/NebulaAuth/MainWindow.xaml +++ b/NebulaAuth/MainWindow.xaml @@ -9,16 +9,17 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:entities="clr-namespace:NebulaAuth.Model.Entities" xmlns:viewModel="clr-namespace:NebulaAuth.ViewModel" + xmlns:controls="clr-namespace:NebulaAuth.Theme.Controls" WindowStartupLocation="CenterScreen" MinHeight="500" MinWidth="500" DefaultFontSize="18" ScaleCoefficient="0.4" - Title="NebulaAuth" Height="800" Width="730" Style="{StaticResource MainWindow}" + Title="NebulaAuth" Height="800" Width="730" + + Style="{StaticResource MainWindow}" RenderOptions.BitmapScalingMode="HighQuality" Foreground="#FFF5F5F5" FontFamily="{md:MaterialDesignFont}" - TextElement.Foreground="{DynamicResource MaterialDesignBody}" + TextElement.Foreground="{DynamicResource BaseContentBrush}" mc:Ignorable="d" d:DataContext="{d:DesignInstance viewModel:MainVM}" - - > @@ -38,7 +39,7 @@ - + @@ -46,9 +47,10 @@ - + + - + @@ -127,7 +129,7 @@ - + @@ -136,7 +138,7 @@ - + @@ -178,10 +180,8 @@ - - - - + + @@ -221,7 +221,7 @@ - + @@ -231,15 +231,13 @@ - - - - + - + + @@ -247,41 +245,36 @@ - + - - - - - - - + - - - - by achies + by achies diff --git a/NebulaAuth/Model/MAAC/PortableMaClient.cs b/NebulaAuth/Model/MAAC/PortableMaClient.cs index 8376151..92019d0 100644 --- a/NebulaAuth/Model/MAAC/PortableMaClient.cs +++ b/NebulaAuth/Model/MAAC/PortableMaClient.cs @@ -17,6 +17,7 @@ using System.Threading; using System.Threading.Tasks; using System.Windows; using AchiesUtilities.Web.Models; +using SteamLib.Utility; namespace NebulaAuth.Model.MAAC; @@ -24,7 +25,7 @@ public partial class PortableMaClient : ObservableObject, IDisposable { public Mafile Mafile { get; } private HttpClient Client { get; } - private HttpClientHandler ClientHandler { get; } + private SocketsHttpHandler ClientHandler { get; } private DynamicProxy Proxy { get; } [ObservableProperty] private bool _autoConfirmTrades; @@ -169,7 +170,7 @@ public partial class PortableMaClient : ObservableObject, IDisposable } - private HttpClientHandlerPair Chp() => new(Client, ClientHandler); + private SocketsClientHandlerPair Chp() => new(Client, ClientHandler); private static string GetLocalization(string key) { diff --git a/NebulaAuth/Model/MaClient.cs b/NebulaAuth/Model/MaClient.cs index 344eb43..1f915e4 100644 --- a/NebulaAuth/Model/MaClient.cs +++ b/NebulaAuth/Model/MaClient.cs @@ -13,20 +13,22 @@ using System.Collections.Generic; using System.Linq; using System.Net.Http; using System.Threading.Tasks; +using SteamLib.Utility; namespace NebulaAuth.Model; + public static class MaClient { - private static HttpClientHandler ClientHandler { get; } + private static SocketsHttpHandler ClientHandler { get; } private static HttpClient Client { get; } private static DynamicProxy Proxy { get; } public static ProxyData? DefaultProxy { get; set; } - public static HttpClientHandlerPair Chp => new(Client, ClientHandler); + public static SocketsClientHandlerPair Chp => new(Client, ClientHandler); static MaClient() { diff --git a/NebulaAuth/Model/SessionHandler.cs b/NebulaAuth/Model/SessionHandler.cs index 8c0e267..40c8a2e 100644 --- a/NebulaAuth/Model/SessionHandler.cs +++ b/NebulaAuth/Model/SessionHandler.cs @@ -8,6 +8,7 @@ using System.Threading; using System.Threading.Tasks; using System.Windows; using NebulaAuth.View.Dialogs; +using SteamLib.Utility; namespace NebulaAuth.Model; @@ -17,7 +18,7 @@ public static partial class SessionHandler private static readonly SemaphoreSlim Semaphore = new(1, 1); public static async Task Handle(Func> func, Mafile mafile, - HttpClientHandlerPair? chp = null, string? snackbarPrefix = null) + SocketsClientHandlerPair? chp = null, string? snackbarPrefix = null) { chp ??= MaClient.Chp; await Semaphore.WaitAsync(); @@ -31,7 +32,7 @@ public static partial class SessionHandler } } - private static async Task HandleInternal(Func> func, HttpClientHandlerPair chp, Mafile mafile, + private static async Task HandleInternal(Func> func, SocketsClientHandlerPair chp, Mafile mafile, string? snackbarPrefix = null) { using var scope = Shell.Logger.PushScopeProperty("Scope", "SessionHandler"); @@ -129,7 +130,7 @@ public static partial class SessionHandler } - private static async Task RefreshInternal(HttpClientHandlerPair chp, Mafile mafile) + private static async Task RefreshInternal(SocketsClientHandlerPair chp, Mafile mafile) { try { @@ -143,7 +144,7 @@ public static partial class SessionHandler } } - private static async Task LoginAgainInternal(HttpClientHandlerPair chp, Mafile mafile, string password, + private static async Task LoginAgainInternal(SocketsClientHandlerPair chp, Mafile mafile, string password, bool savePassword) { var t = Task.Run(OnLoginStarted); diff --git a/NebulaAuth/Model/SessionHandler_API.cs b/NebulaAuth/Model/SessionHandler_API.cs index 9c9e7c0..bd7b799 100644 --- a/NebulaAuth/Model/SessionHandler_API.cs +++ b/NebulaAuth/Model/SessionHandler_API.cs @@ -7,12 +7,13 @@ using SteamLib.Authentication.LoginV2; using SteamLib.Exceptions; using SteamLib.SteamMobile; using System.Threading.Tasks; +using SteamLib.Utility; namespace NebulaAuth.Model; public partial class SessionHandler //API { - public static async Task RefreshMobileToken(HttpClientHandlerPair chp, Mafile mafile) + public static async Task RefreshMobileToken(SocketsClientHandlerPair chp, Mafile mafile) { if (mafile.SessionData is not { RefreshToken.IsExpired: false }) throw new SessionPermanentlyExpiredException(SessionInvalidException.SESSION_NULL_MSG); @@ -30,7 +31,7 @@ public partial class SessionHandler //API chp.Handler.CookieContainer.SetSteamMobileCookiesWithMobileToken(mafile.SessionData); } - public static async Task LoginAgain(HttpClientHandlerPair chp, Mafile mafile, string password, bool savePassword) + public static async Task LoginAgain(SocketsClientHandlerPair chp, Mafile mafile, string password, bool savePassword) { var sgGenerator = new SteamGuardCodeGenerator(mafile.SharedSecret); var options = new LoginV2ExecutorOptions(LoginV2Executor.NullConsumer, chp.Client) diff --git a/NebulaAuth/NebulaAuth.csproj b/NebulaAuth/NebulaAuth.csproj index 3660279..80fd9e6 100644 --- a/NebulaAuth/NebulaAuth.csproj +++ b/NebulaAuth/NebulaAuth.csproj @@ -1,48 +1,47 @@  - - WinExe - net8.0-windows7.0 - enable - true - true - latest - en;ru;ua - Theme\lock.ico - 7.0 - 1.5.5 - true - - - - - - - - - - - - - - - - - - - - - - - - - Never - - - + + WinExe + net8.0-windows7.0 + enable + true + true + latest + en;ru;ua + Theme\lock.ico + 7.0 + 1.5.5 + true + - + + + + + + + + + + + + + + + + + + + + + Never + + + + + + @@ -50,19 +49,19 @@ - - Code - + + Code + - - - Always - - - Always - - + + + Always + + + Always + + diff --git a/NebulaAuth/PlannedChanges.txt b/NebulaAuth/PlannedChanges.txt index bac9938..d800fe0 100644 --- a/NebulaAuth/PlannedChanges.txt +++ b/NebulaAuth/PlannedChanges.txt @@ -6,4 +6,8 @@ • Добавить запоминание пароля при привязке мафайла • Функция переноса гуарда с мобильного устройства на ПК с созданием мафайла • Добавить полное шифрование мафайлов по аналогии с SDA -• Сделать автоматический билд и загрузку обновления на Github при изменении в мастер ветке \ No newline at end of file +• Сделать автоматический билд и загрузку обновления на Github при изменении в мастер ветке +• Антик-окно как в MarketApp, возможность сразу открыть браузер напр. на CefSharp с залогиненым аккаунтом +• Стабильность авто-подтверждений, возможность задать пользователю порог времени когда льются ошибки и только тогда выключать авто-подтверждение +• Безопасное сохранение мафайлов через .tmp / .bak +• Создание механизма накопления ошибок, чтобы исправить Patch Tuesday, условно аккаунт может игнорировать ошибки 1-2 часа (настриавемо) \ No newline at end of file diff --git a/NebulaAuth/Theme/Brushes.xaml b/NebulaAuth/Theme/Brushes.xaml index d96edc1..70b70a2 100644 --- a/NebulaAuth/Theme/Brushes.xaml +++ b/NebulaAuth/Theme/Brushes.xaml @@ -1,9 +1,66 @@  + + + #794DFF + #eae7ff + #76717f + #ffffff + #3b82f6 + #dbeafe + #928f9e + #141119 + #282332 + #1d1a26 + #4a4456 + #231f2c + #b8b6c0 + #1e1e24 + #06b6d4 + #cffafe + #02ca4b + #e1faf1 + #fcaa1d + #fffae8 + #fb4141 + #fff5ed + + #d66d1c + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + \ No newline at end of file diff --git a/NebulaAuth/Theme/Controls/CodeProgressBar.cs b/NebulaAuth/Theme/Controls/CodeProgressBar.cs new file mode 100644 index 0000000..e5053e9 --- /dev/null +++ b/NebulaAuth/Theme/Controls/CodeProgressBar.cs @@ -0,0 +1,53 @@ +namespace NebulaAuth.Theme.Controls; + +using System; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Media.Animation; + +public class CodeProgressBar : ProgressBar +{ + public static readonly DependencyProperty TimeRemainingProperty = + DependencyProperty.Register(nameof(TimeRemaining), typeof(double), typeof(CodeProgressBar), + new PropertyMetadata(-1.0, OnTimeRemainingChanged)); + + public static readonly DependencyProperty MaxTimeProperty = + DependencyProperty.Register(nameof(MaxTime), typeof(double), typeof(CodeProgressBar), + new PropertyMetadata(30.0)); // По умолчанию 30 сек + + public double TimeRemaining + { + get => (double)GetValue(TimeRemainingProperty); + set => SetValue(TimeRemainingProperty, value); + } + + public double MaxTime + { + get => (double)GetValue(MaxTimeProperty); + set => SetValue(MaxTimeProperty, value); + } + + private static void OnTimeRemainingChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + if (d is CodeProgressBar progressBar) + { + var newValue = (double)e.NewValue; + progressBar.StartProgressAnimation(newValue); + } + } + + private void StartProgressAnimation(double timeRemaining) + { + if (timeRemaining <= 0 || MaxTime <= 0) return; + var progress = (1 - (timeRemaining / MaxTime)) * 100; + + var animation = new DoubleAnimation + { + From = progress, + To = 100, + Duration = TimeSpan.FromSeconds(timeRemaining), + }; + + BeginAnimation(ValueProperty, animation); + } +} diff --git a/NebulaAuth/Theme/MaterialDesignThemes.Overrides.xaml b/NebulaAuth/Theme/MaterialDesignThemes.Overrides.xaml new file mode 100644 index 0000000..6c13a2f --- /dev/null +++ b/NebulaAuth/Theme/MaterialDesignThemes.Overrides.xaml @@ -0,0 +1,17 @@ + + + + + + + + + \ No newline at end of file diff --git a/NebulaAuth/Theme/SplashScreen.png b/NebulaAuth/Theme/SplashScreen.png index 3255bc0..8132397 100644 Binary files a/NebulaAuth/Theme/SplashScreen.png and b/NebulaAuth/Theme/SplashScreen.png differ diff --git a/NebulaAuth/Theme/SplashScreen2.psd b/NebulaAuth/Theme/SplashScreen2.psd new file mode 100644 index 0000000..b963ea2 Binary files /dev/null and b/NebulaAuth/Theme/SplashScreen2.psd differ diff --git a/NebulaAuth/Theme/WindowStyle/WindowStyle.xaml b/NebulaAuth/Theme/WindowStyle/WindowStyle.xaml index 69b3133..cccef50 100644 --- a/NebulaAuth/Theme/WindowStyle/WindowStyle.xaml +++ b/NebulaAuth/Theme/WindowStyle/WindowStyle.xaml @@ -17,7 +17,9 @@ Margin="{x:Static local:WindowChromeHelper.LayoutOffsetThickness}" BorderBrush="Transparent" BorderThickness="1" - Background="{DynamicResource WindowBackground}"> + Background="{DynamicResource BackgroundBrush}" + > + @@ -26,10 +28,11 @@ + Background="{DynamicResource Base100Brush}"> + diff --git a/NebulaAuth/Theme/b5ae87e0-572c-40e5-a7b8-7f9660c5f7c7.jpg b/NebulaAuth/Theme/b5ae87e0-572c-40e5-a7b8-7f9660c5f7c7.jpg new file mode 100644 index 0000000..e33b9f3 Binary files /dev/null and b/NebulaAuth/Theme/b5ae87e0-572c-40e5-a7b8-7f9660c5f7c7.jpg differ diff --git a/NebulaAuth/Theme/b5ae87e0-572c-40e5-a7b8-7f9660c5f7c72.png b/NebulaAuth/Theme/b5ae87e0-572c-40e5-a7b8-7f9660c5f7c72.png new file mode 100644 index 0000000..4398eaf Binary files /dev/null and b/NebulaAuth/Theme/b5ae87e0-572c-40e5-a7b8-7f9660c5f7c72.png differ diff --git a/NebulaAuth/Theme/lock.ico b/NebulaAuth/Theme/lock.ico index 3397e22..f88e268 100644 Binary files a/NebulaAuth/Theme/lock.ico and b/NebulaAuth/Theme/lock.ico differ diff --git a/NebulaAuth/Theme/lock_old.ico b/NebulaAuth/Theme/lock_old.ico new file mode 100644 index 0000000..3397e22 Binary files /dev/null and b/NebulaAuth/Theme/lock_old.ico differ diff --git a/NebulaAuth/View/Dialogs/SetCryptPasswordDialog.xaml b/NebulaAuth/View/Dialogs/SetCryptPasswordDialog.xaml index 051a197..126abfb 100644 --- a/NebulaAuth/View/Dialogs/SetCryptPasswordDialog.xaml +++ b/NebulaAuth/View/Dialogs/SetCryptPasswordDialog.xaml @@ -7,9 +7,7 @@ xmlns:theme="clr-namespace:NebulaAuth.Theme" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - Foreground="WhiteSmoke" - d:DataContext="{d:DesignInstance other:LoginAgainVM}" - Background="{DynamicResource WindowBackground}"> + d:DataContext="{d:DesignInstance other:LoginAgainVM}"> diff --git a/NebulaAuth/View/ProxyManagerView.xaml b/NebulaAuth/View/ProxyManagerView.xaml index 469611a..c55408c 100644 --- a/NebulaAuth/View/ProxyManagerView.xaml +++ b/NebulaAuth/View/ProxyManagerView.xaml @@ -7,13 +7,12 @@ xmlns:other="clr-namespace:NebulaAuth.ViewModel.Other" mc:Ignorable="d" d:DesignHeight="500" d:DesignWidth="400" - Foreground="WhiteSmoke" FontFamily="{md:MaterialDesignFont}" MinHeight="500" MinWidth="400" MaxHeight="550" d:DataContext="{d:DesignInstance other:ProxyManagerVM}" - Background="{DynamicResource WindowBackground}"> + Background="{DynamicResource BackgroundBrush1}"> diff --git a/NebulaAuth/ViewModel/MainVM.cs b/NebulaAuth/ViewModel/MainVM.cs index c253df0..beeeda8 100644 --- a/NebulaAuth/ViewModel/MainVM.cs +++ b/NebulaAuth/ViewModel/MainVM.cs @@ -14,6 +14,8 @@ using System.Collections.ObjectModel; using System.Collections.Specialized; using System.Linq; using System.Threading.Tasks; +using System.Windows.Controls; +using System.Windows.Media; namespace NebulaAuth.ViewModel; @@ -52,6 +54,20 @@ public partial class MainVM : ObservableObject } } + [RelayCommand] + public void Debug() + { + var ph = new PaletteHelper(); + var t = new MaterialDesignThemes.Wpf.Theme(); + var cur = ph.GetTheme(); + t.SetDarkTheme(); + ph.SetTheme(t); + + + + return; + } + private void SetMafile(Mafile? mafile) { diff --git a/NebulaAuth/ViewModel/MainVM_Code.cs b/NebulaAuth/ViewModel/MainVM_Code.cs index 17b964b..d01cbf2 100644 --- a/NebulaAuth/ViewModel/MainVM_Code.cs +++ b/NebulaAuth/ViewModel/MainVM_Code.cs @@ -4,10 +4,12 @@ using NebulaAuth.Core; using NebulaAuth.Model; using SteamLib.SteamMobile; using System; +using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; using System.Windows; +using System.Windows.Media.Animation; using System.Windows.Threading; namespace NebulaAuth.ViewModel; @@ -22,6 +24,7 @@ public partial class MainVM [MemberNotNull(nameof(_codeTimer))] private void CreateCodeTimer() { + CodeProgress = CalculateCodeProgress(); _codeTimer = new Timer(UpdateCode, null, 0, 1000); } @@ -31,24 +34,30 @@ public partial class MainVM { var currentTime = TimeAligner.GetSteamTime(); var untilChange = currentTime % 30; - var codeProgress = untilChange / 30D * 100; - - string? code = null; - if (untilChange == 0 && SelectedMafile != null) - { - code = SteamGuardCodeGenerator.GenerateCode(SelectedMafile!.SharedSecret); - } - + if (untilChange != 0) return; if (Application.Current == null) return; - Application.Current.Dispatcher.BeginInvoke((string? c) => + Application.Current.Dispatcher.BeginInvoke(() => { + CodeProgress = -1; + CodeProgress = 30; if (Application.Current.MainWindow?.WindowState == WindowState.Minimized) return; - CodeProgress = codeProgress; - if (c != null) Code = c; - }, DispatcherPriority.DataBind, code); + if (SelectedMafile == null) return; + Code = SteamGuardCodeGenerator.GenerateCode(SelectedMafile.SharedSecret); + }, DispatcherPriority.DataBind); } + + private long CalculateCodeProgress() + { + var currentTime = TimeAligner.GetSteamTime(); + var untilChange = currentTime % 30; + return 30 - untilChange; + } + + + + [RelayCommand(AllowConcurrentExecutions = false)] private async Task CopyCode() { diff --git a/NebulaAuth/ViewModel/Other/LinkAccountVM.cs b/NebulaAuth/ViewModel/Other/LinkAccountVM.cs index d84711a..f21b20e 100644 --- a/NebulaAuth/ViewModel/Other/LinkAccountVM.cs +++ b/NebulaAuth/ViewModel/Other/LinkAccountVM.cs @@ -79,7 +79,7 @@ public partial class LinkAccountVM : ObservableObject, IEmailProvider, IPhoneNum #region HttpClient private static HttpClient Client { get; } - private static HttpClientHandler Handler { get; } + private static SocketsHttpHandler Handler { get; } private static DynamicProxy Proxy { get; } public ObservableDictionary Proxies => ProxyStorage.Proxies; diff --git a/SteamLibForked/Utility/SocketsClientHandlerPair.cs b/SteamLibForked/Utility/SocketsClientHandlerPair.cs new file mode 100644 index 0000000..e0bf923 --- /dev/null +++ b/SteamLibForked/Utility/SocketsClientHandlerPair.cs @@ -0,0 +1,17 @@ +namespace SteamLib.Utility; + +public readonly struct SocketsClientHandlerPair +{ + public SocketsHttpHandler Handler { get; } + public HttpClient Client { get; } + + public SocketsClientHandlerPair(HttpClient client, SocketsHttpHandler handler) + { + Handler = handler; + Client = client; + } + public (SocketsHttpHandler, HttpClient) Deconstruct() + { + return (Handler, Client); + } +} \ No newline at end of file diff --git a/SteamLibForked/Web/ClientBuilder.cs b/SteamLibForked/Web/ClientBuilder.cs index 08fbe4a..623e87c 100644 --- a/SteamLibForked/Web/ClientBuilder.cs +++ b/SteamLibForked/Web/ClientBuilder.cs @@ -3,15 +3,16 @@ using System.Net.Http.Headers; using AchiesUtilities.Web.Models; using SteamLib.Authentication; using SteamLib.Core.Interfaces; +using SteamLib.Utility; namespace SteamLib.Web; public static class ClientBuilder { - public static HttpClientHandlerPair BuildMobileClient(IWebProxy? proxy, IMobileSessionData? sessionData, bool disposeHandler = true) + public static SocketsClientHandlerPair BuildMobileClient(IWebProxy? proxy, IMobileSessionData? sessionData, bool disposeHandler = true) { sessionData?.EnsureValidated(); - var handler = new HttpClientHandler(); + var handler = new SocketsHttpHandler(); var client = new HttpClient(handler, disposeHandler); client.DefaultRequestHeaders.Accept.ParseAdd("application/json, text/javascript, text/html, application/xml, text/xml, */*"); @@ -33,12 +34,12 @@ public static class ClientBuilder } ConfigureCommon(handler, client); - return new HttpClientHandlerPair(client, handler); + return new SocketsClientHandlerPair(client, handler); } - private static void ConfigureCommon(HttpClientHandler handler, HttpClient client) + private static void ConfigureCommon(SocketsHttpHandler handler, HttpClient client) { ConfigureCommonClient(client); handler.AutomaticDecompression = DecompressionMethods.Deflate | DecompressionMethods.GZip;