PROXY
Posted: Thu Dec 09, 2021 4:39 pm
Hello, there is a problem, there is a form on which there is a checkbox that disables or enables proxies, the problem is that proxies are enabled but after unchecking they are not disabled!.
Code: Select all
begin
if CheckBox1.Checked = false then
begin
TempCache := GlobalCEFApp.RootCache + '\root_cache\user1';
TempContext := TCefRequestContextRef.New(TempCache, '', '', False, False, False) ;
Chromium1.LoadURL(edit1.text);
Chromium1.CreateBrowser(CEFWindowParent1, '', TempContext);
Chromium1.UpdatePreferences;
end;
if CheckBox1.Checked = true then
begin
Chromium1.ProxyType := CEF_PROXYTYPE_FIXED_SERVERS;
Chromium1.ProxyScheme := psSOCKS5;
Chromium1.ProxyServer := form2.edit1.text;
Chromium1.ProxyPort := StrToInt(form2.edit2.text);
Chromium1.ProxyUsername := '';
Chromium1.ProxyPassword := '';
TempCache := GlobalCEFApp.RootCache + '\root_cache\user1';
TempContext := TCefRequestContextRef.New(TempCache, '', '', False, False, False) ;
Chromium1.LoadURL(edit1.text);
Chromium1.CreateBrowser(CEFWindowParent1, '', TempContext);
Chromium1.UpdatePreferences;
end;
end;