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.

Two proxies in the same application

User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Two proxies in the same application

Post 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.
snoop
Posts: 75
Joined: Mon Jul 10, 2017 12:06 pm

Re: Two proxies in the same application

Post by snoop »

Hello. Still stuck at this problem
But I have an idea now
Can I change requestcontext of browser at runtime?
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Two proxies in the same application

Post 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.
///
dilfich
Posts: 330
Joined: Thu Nov 30, 2017 1:17 am

Re: Two proxies in the same application

Post by dilfich »

There is a problem with socks proxy, if a proxy for example port 68 does not work, what could be the problem?
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Two proxies in the same application

Post by salvadordf »

Chromium has some limitations with that kind of proxies.
Try Chrome or Chromium to see if they work with that proxy configuration.
dilfich
Posts: 330
Joined: Thu Nov 30, 2017 1:17 am

Re: Two proxies in the same application

Post 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...
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Two proxies in the same application

Post 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.
dilfich
Posts: 330
Joined: Thu Nov 30, 2017 1:17 am

Re: Two proxies in the same application

Post by dilfich »

It seems to me or SOCKS with authorization does not work?
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Two proxies in the same application

Post 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.
dilfich
Posts: 330
Joined: Thu Nov 30, 2017 1:17 am

Re: Two proxies in the same application

Post by dilfich »

If you remove the authorization (username and password) then it works.
You do not have the required permissions to view the files attached to this post.
Post Reply