Fix Proxy

This commit is contained in:
Harry Yu 2021-02-01 16:03:13 +08:00
parent d509b11491
commit 4cd093dbdf
2 changed files with 4 additions and 2 deletions

View file

@ -34,6 +34,7 @@ namespace Flow.Launcher.Infrastructure.Http
client = new HttpClient(socketsHttpHandler, false); client = new HttpClient(socketsHttpHandler, false);
client.DefaultRequestHeaders.Add("User-Agent", UserAgent); client.DefaultRequestHeaders.Add("User-Agent", UserAgent);
HttpClient.DefaultProxy = WebProxy;
} }
private static HttpProxy proxy; private static HttpProxy proxy;
@ -45,6 +46,7 @@ namespace Flow.Launcher.Infrastructure.Http
{ {
proxy = value; proxy = value;
proxy.PropertyChanged += UpdateProxy; proxy.PropertyChanged += UpdateProxy;
UpdateProxy(ProxyProperty.Enabled);
} }
} }

View file

@ -61,6 +61,8 @@ namespace Flow.Launcher
_settingsVM = new SettingWindowViewModel(_updater, _portable); _settingsVM = new SettingWindowViewModel(_updater, _portable);
_settings = _settingsVM.Settings; _settings = _settingsVM.Settings;
Http.Proxy = _settings.Proxy;
_alphabet.Initialize(_settings); _alphabet.Initialize(_settings);
_stringMatcher = new StringMatcher(_alphabet); _stringMatcher = new StringMatcher(_alphabet);
StringMatcher.Instance = _stringMatcher; StringMatcher.Instance = _stringMatcher;
@ -85,8 +87,6 @@ namespace Flow.Launcher
ThemeManager.Instance.Settings = _settings; ThemeManager.Instance.Settings = _settings;
ThemeManager.Instance.ChangeTheme(_settings.Theme); ThemeManager.Instance.ChangeTheme(_settings.Theme);
Http.Proxy = _settings.Proxy;
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
RegisterExitEvents(); RegisterExitEvents();