Separate proxies for browsers with one cache
Posted: Sat Aug 31, 2019 5:14 am
Hello! I have 3 browsers in the project. I need to make every browser have the ability to work with different proxies. I created a new RequestContext for each browser. Browsers open under different proxies, but cookies, cache, etc. are not transmitted between them. We read a lot of information on the Internet, but did not find a solution. Help me please!
CEF Initialization Settings
Browser Settings on Opening
With these settings, they use the same cache but the proxies are the same for everyone. I need the cache to be one for all and different proxies.
I am using WPF.
CEF Initialization Settings
- Code: Select all
var settings = new CefSettings()
{
CachePath = CachePath,
LogFile = CachePath,
LogSeverity = LogSeverity.Disable,
AcceptLanguageList = "en-US",
IgnoreCertificateErrors = true,
PersistSessionCookies = true,
UserAgent = userAgent ?? "Mozilla/5.0 (Linux; Android 7.1.1; ASUS_X00ID Build/NMF26F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Mobile Safari/537.36"
};
Browser Settings on Opening
- Code: Select all
public BookmakerAuthWindow(string reference, string bookmaker, bool isAuth)
{
InitializeComponent();
var requestContextSettings = new RequestContextSettings { CachePath = CefSharpHelper.CachePath + @"\Browser" };
browser.RequestContext = new RequestContext(requestContextSettings);
browser.JavascriptObjectRepository.Register("CallbackService", new CallbackService(), true);
InitializationComponents(reference, bookmaker, isAuth);
}
With these settings, they use the same cache but the proxies are the same for everyone. I need the cache to be one for all and different proxies.
I am using WPF.