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
16
16
{
17
17
private const string UserAgent = @"Mozilla/5.0 (Trident/7.0; rv:11.0) like Gecko" ;
18
18
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 ( ) ;
26
20
27
21
static Http ( )
28
22
{
@@ -32,8 +26,8 @@ static Http()
32
26
| SecurityProtocolType . Tls11
33
27
| SecurityProtocolType . Tls12 ;
34
28
35
- client = new HttpClient ( socketsHttpHandler , false ) ;
36
29
client . DefaultRequestHeaders . Add ( "User-Agent" , UserAgent ) ;
30
+ HttpClient . DefaultProxy = WebProxy ;
37
31
}
38
32
39
33
private static HttpProxy proxy ;
@@ -45,6 +39,7 @@ public static HttpProxy Proxy
45
39
{
46
40
proxy = value ;
47
41
proxy . PropertyChanged += UpdateProxy ;
42
+ UpdateProxy ( ProxyProperty . Enabled ) ;
48
43
}
49
44
}
50
45
Original file line number Diff line number Diff line change @@ -61,6 +61,8 @@ await Stopwatch.NormalAsync("|App.OnStartup|Startup cost", async () =>
61
61
_settingsVM = new SettingWindowViewModel ( _updater , _portable ) ;
62
62
_settings = _settingsVM . Settings ;
63
63
64
+ Http . Proxy = _settings . Proxy ;
65
+
64
66
_alphabet . Initialize ( _settings ) ;
65
67
_stringMatcher = new StringMatcher ( _alphabet ) ;
66
68
StringMatcher . Instance = _stringMatcher ;
@@ -85,8 +87,6 @@ await Stopwatch.NormalAsync("|App.OnStartup|Startup cost", async () =>
85
87
ThemeManager . Instance . Settings = _settings ;
86
88
ThemeManager . Instance . ChangeTheme ( _settings . Theme ) ;
87
89
88
- Http . Proxy = _settings . Proxy ;
89
-
90
90
Encoding . RegisterProvider ( CodePagesEncodingProvider . Instance ) ;
91
91
92
92
RegisterExitEvents ( ) ;
You can’t perform that action at this time.
0 commit comments