I tried to find a public proxy server protected by a username and password but it seems that all public servers don't need a password.
I tested the MDIBrowser adding the proxy settings in the TChildForm.FormShow procedure like this :
Code: Select all
procedure TChildForm.FormShow(Sender: TObject);
var
TempContext : ICefRequestContext;
begin
// The new request context overrides several GlobalCEFApp properties like :
// cache, AcceptLanguageList, PersistSessionCookies, PersistUserPreferences,
// IgnoreCertificateErrors and EnableNetSecurityExpiration
// If you use an empty cache path, CEF will use in-memory cache.
if MainForm.NewContextChk.Checked then
TempContext := TCefRequestContextRef.New('', '', False, False, False, False)
else
TempContext := nil;
Chromium1.ProxyType := CEF_PROXYTYPE_FIXED_SERVERS;
Chromium1.ProxyScheme := psSOCKS5;
Chromium1.ProxyServer := '189.102.74.134';
Chromium1.ProxyPort := 33601;
Chromium1.ProxyUsername := '';
Chromium1.ProxyPassword := '';
// In case you used a custom cookies path in the GlobalCEFApp you can
// override it in the TChromium.CreateBrowser function
Chromium1.CreateBrowser(CEFWindowParent1, '', TempContext);
end;
I compiled and run MDIBrowser. Then I opened several child windows and visited some websites that show your IP. All of them told me that I was using an IP from Brazil, not from Spain.
Please check this in your application :
- Set the proxy settings in all your browsers. If you get a 407, set a breakpoint at the TChromium.doOnGetAuthCredentials procedure and check that the callback.cont function is called with the right username and password.
- Check that the proxy server that shows a 407 error allows you to have multiple sessions with the same username and password.
- Browsers with different request contexts can't share the same cache and cookies directory.
- Many public proxy servers limit the number of connections, used bandwidth, etc.