2

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);
Zolll
  • 21
  • 3
  • Could you please clarify whether all the Browser instances you have created use different BrowserContexts? The proxy settings are bound to a BrowserContext, not a Browser. – Anna Dolbina Apr 10 '17 at 06:48
  • BrowserContexts are different , I added the code to my post, you can check it – Zolll Apr 10 '17 at 09:47
  • 1
    The described issue has already been reported by a few customers. We have already fixed it. The fix for this issue will be officially available in the next release version of DotNetBrowser. If the presence of this fix is critical foir you, please contact DotNetBrowser support and request a preview build with this fix. Link: https://dotnetbrowser.support.teamdev.com – Vladyslav Tsvek Apr 11 '17 at 12:51

1 Answers1

0

I am happy to let you know that we've just released DotNetBrowser 1.10. The mentioned issue has been resolved. You are welcome to download the new version: https://www.teamdev.com/dotnetbrowser