Page 2 of 3

Re: Two proxies in the same application

Posted: Mon Mar 26, 2018 3:50 pm
by salvadordf
CEF doesn't have a "clear cache" function, not even when you use cache in memory.

You can use TChromium.ReloadIgnoreCache to reload the web page ignoring the cache.

Re: Two proxies in the same application

Posted: Fri Apr 13, 2018 11:19 pm
by snoop
Hello. Still stuck at this problem
But I have an idea now
Can I change requestcontext of browser at runtime?

Re: Two proxies in the same application

Posted: Sat Apr 14, 2018 6:30 am
by salvadordf
Hi,

You can change the proxy settings and some preferences at run-time but the request conquest can only be assigned when you create the browser.
CEF doesn't allow to change the request context after the browser has been created.

These are the code comments about request contexts in the CEF sources.
https://github.com/chromiumembedded/cef ... ext_capi.h

Code: Select all

///
// A request context provides request handling for a set of related browser or
// URL request objects. A request context can be specified when creating a new
// browser via the cef_browser_host_t static factory functions or when creating
// a new URL request via the cef_urlrequest_t static factory functions. Browser
// objects with different request contexts will never be hosted in the same
// render process. Browser objects with the same request context may or may not
// be hosted in the same render process depending on the process model. Browser
// objects created indirectly via the JavaScript window.open function or
// targeted links will share the same render process and the same request
// context as the source browser. When running in single-process mode there is
// only a single render process (the main process) and so all browsers created
// in single-process mode will share the same request context. This will be the
// first request context passed into a cef_browser_host_t static factory
// function and all other request context objects will be ignored.
///

Re: Two proxies in the same application

Posted: Tue Jul 03, 2018 11:17 am
by dilfich
There is a problem with socks proxy, if a proxy for example port 68 does not work, what could be the problem?

Re: Two proxies in the same application

Posted: Tue Jul 03, 2018 12:51 pm
by salvadordf
Chromium has some limitations with that kind of proxies.
Try Chrome or Chromium to see if they work with that proxy configuration.

Re: Two proxies in the same application

Posted: Wed Sep 12, 2018 9:30 am
by dilfich

Code: Select all

TCefRequestContextRef.New(PtchCache, 'en', True, True, True, False);
How to specify the path to the cookies and to change it during operation?
With one browser changed so..

Code: Select all

 CookiesPatch:= TCefCookieManagerRef.Global(CefBack);
 CookiesPatch.SetStoragePath(ExtractFilePath(Application.ExeName) + 'Cookies_1', True, CefBack);
And how to change two browsers if they have different settings? They have cookies in their cache folder...

Re: Two proxies in the same application

Posted: Wed Sep 12, 2018 7:21 pm
by salvadordf
I've never done that but try this :

Call TChromium.Browser.Host.RequestContext.GetDefaultCookieManager(nil) to get the ICefCookieManager for that browser.

Then try calling ICefCookieManager.SetStoragePath but I'm not sure it can be changed after the TChromium is fully initialized.

Re: Two proxies in the same application

Posted: Wed Apr 24, 2019 9:59 am
by dilfich
It seems to me or SOCKS with authorization does not work?

Re: Two proxies in the same application

Posted: Thu Apr 25, 2019 9:02 am
by salvadordf
Please, provide all the details you can about that issue and some code to test it.

I'm busy these days but I'll take a look as soon as I can.

Re: Two proxies in the same application

Posted: Tue Apr 30, 2019 11:01 am
by dilfich
If you remove the authorization (username and password) then it works.