from the documentation: "You can configure Browser instance to use its own proxy settings. When you modify Browser proxy settings you don't modify the system global proxy settings."
Can i use multiple browsers with different proxy settings?
As i see , the proxy settings is global on all browser instances and i cant turn it off/on separatly (for example before the loadurl method)
1, I create a browser instances with proxy settings
2, I create another browser instances without any proxy settings (directproxy)
3, I click on a link in the first browser instance( or invoke loadurl) but it does not work, proxy settings was probably overridden , authentication does not work
4, i tried to reset the proxy setting but it also does not work
public void LoadURL(string link)
{
Browser.Context.ProxyConfig = Forms.DotNetBrowserForm.noProxyContext;
if (Utils.UseProxy(link))
{
Browser.Context.ProxyConfig = Forms.DotNetBrowserForm.proxyContext;
Browser.Context.NetworkService.NetworkDelegate = new MyNetworkDelegate();
}
..... the OnAuthRequired(AuthRequiredParams parameters) method in MyNetworkDelegate(); wont be invoked again (only at first time when there is no other browser instances with no proxy setting )
So what is the deal ? How could this happen ? How could a new browser instance with a different browsercontext override an earlier created browser instance and why cant i reset its parameters ?
Edit: (browsercontexts not the same )
if (Utils.UseProxy(bookiename))
{
String dataDir = Path.GetFullPath("chromium-data");
BrowserContextParams contextParams = new BrowserContextParams(dataDir);
String proxyRules = string.Format("http={0};https={0};ftp={0};socks={0}", Properties.Settings.Default.proxyserver);
contextParams.ProxyConfig = new CustomProxyConfig(proxyRules);
browser = BrowserFactory.Create(new BrowserContext(contextParams));
browser.Context.NetworkService.NetworkDelegate = new MyNetworkDelegate();
}
else
{
BrowserContextParams contextParams = new BrowserContextParams("CookieStorage/" + bookiename + Guid.NewGuid());
contextParams.ProxyConfig = new DirectProxyConfig();
browser = BrowserFactory.Create(new BrowserContext(contextParams));
}
BrowserView browserView = new WinFormsBrowserView(browser);