File tree Expand file tree Collapse file tree 2 files changed +5
-10
lines changed
Flow.Launcher.Infrastructure/Http Expand file tree Collapse file tree 2 files changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -16,13 +16,7 @@ public static class Http
1616 {
1717 private const string UserAgent = @"Mozilla/5.0 (Trident/7.0; rv:11.0) like Gecko" ;
1818
19- private static HttpClient client ;
20-
21- private static SocketsHttpHandler socketsHttpHandler = new SocketsHttpHandler ( )
22- {
23- UseProxy = true ,
24- Proxy = WebProxy
25- } ;
19+ private static HttpClient client = new HttpClient ( ) ;
2620
2721 static Http ( )
2822 {
@@ -32,8 +26,8 @@ static Http()
3226 | SecurityProtocolType . Tls11
3327 | SecurityProtocolType . Tls12 ;
3428
35- client = new HttpClient ( socketsHttpHandler , false ) ;
3629 client . DefaultRequestHeaders . Add ( "User-Agent" , UserAgent ) ;
30+ HttpClient . DefaultProxy = WebProxy ;
3731 }
3832
3933 private static HttpProxy proxy ;
@@ -45,6 +39,7 @@ public static HttpProxy Proxy
4539 {
4640 proxy = value ;
4741 proxy . PropertyChanged += UpdateProxy ;
42+ UpdateProxy ( ProxyProperty . Enabled ) ;
4843 }
4944 }
5045
Original file line number Diff line number Diff line change @@ -61,6 +61,8 @@ await Stopwatch.NormalAsync("|App.OnStartup|Startup cost", async () =>
6161 _settingsVM = new SettingWindowViewModel ( _updater , _portable ) ;
6262 _settings = _settingsVM . Settings ;
6363
64+ Http . Proxy = _settings . Proxy ;
65+
6466 _alphabet . Initialize ( _settings ) ;
6567 _stringMatcher = new StringMatcher ( _alphabet ) ;
6668 StringMatcher . Instance = _stringMatcher ;
@@ -85,8 +87,6 @@ await Stopwatch.NormalAsync("|App.OnStartup|Startup cost", async () =>
8587 ThemeManager . Instance . Settings = _settings ;
8688 ThemeManager . Instance . ChangeTheme ( _settings . Theme ) ;
8789
88- Http . Proxy = _settings . Proxy ;
89-
9090 Encoding . RegisterProvider ( CodePagesEncodingProvider . Instance ) ;
9191
9292 RegisterExitEvents ( ) ;
You can’t perform that action at this time.
0 commit comments