From c77168b393b3027934354c113124d91293d5117f Mon Sep 17 00:00:00 2001 From: Dan Cojocaru Date: Sun, 1 Sep 2024 04:56:14 +0200 Subject: [PATCH] Update proxy credentials logic --- server/Services/Implementations/DataManager.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/Services/Implementations/DataManager.cs b/server/Services/Implementations/DataManager.cs index 5bac346..5a15959 100644 --- a/server/Services/Implementations/DataManager.cs +++ b/server/Services/Implementations/DataManager.cs @@ -29,8 +29,9 @@ namespace Server.Services.Implementations { HttpClientHandler httpClientHandler = new() { UseProxy = proxySettings.Value.UseProxy, - Proxy = proxySettings.Value.UseProxy ? new WebProxy(proxySettings.Value.Url) : null, - DefaultProxyCredentials = string.IsNullOrEmpty(proxySettings.Value.Credentials?.Username) ? null : new NetworkCredential(proxySettings.Value.Credentials.Username, proxySettings.Value.Credentials.Password), + Proxy = proxySettings.Value.UseProxy ? new WebProxy(proxySettings.Value.Url) { + Credentials = string.IsNullOrEmpty(proxySettings.Value.Credentials?.Username) ? null : new NetworkCredential(proxySettings.Value.Credentials.Username, proxySettings.Value.Credentials.Password), + } : null, }; InfoferScraper.Scrapers.StationScraper stationScraper = new(httpClientHandler); InfoferScraper.Scrapers.TrainScraper trainScraper = new(httpClientHandler);