Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.

Proxies overwrite each other

Post Reply
micmorozov
Posts: 18
Joined: Mon Oct 07, 2019 7:53 am

Proxies overwrite each other

Post by micmorozov »

In two tabs I dynamically create two browsers and in CEF_AFTERCREATED for each I specify my proxies and call UpdatePreferences.
The problem is that the browser created by the second overwrites the proxy settings of the first and vice versa.

Browsers are created at the same time. If you create with an interval, then there is no problem.

It feels like
task TempTask := TCefUpdatePrefsTask.Create(self); the second browser overwrites the task of the first.

Can't find solutions. Please advise how to proceed.
Thanks
User avatar
salvadordf
Posts: 4057
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Proxies overwrite each other

Post by salvadordf »

All the browsers that share the same request context also share the same proxy settings. By default, all the browsers share the global request context and the same proxy settings.

Try creating independent browsers with different request contexts (TCefRequestContextRef) as you can see in the MDIBrowser demo :
https://github.com/salvadordf/CEF4Delphi/blob/b1cbe9382c1df54d7a98a4838ba96142deec3a75/demos/Delphi_VCL/MDIBrowser/uChildForm.pas#L218
micmorozov
Posts: 18
Joined: Mon Oct 07, 2019 7:53 am

Re: Proxies overwrite each other

Post by micmorozov »

Thanks, it helped!
Post Reply