0

I've followed the documentation here, https://dotnetbrowser.support.teamdev.com/support/solutions/articles/9000110853-configuring-proxy to configure a proxy using the DotNetBrowser by TeamDev and it's not detecting my proxy at all.

                string mainPage = "https://www.example.com";
                String proxyRules = "http=127.0.0.1:8085;https=127.0.0.1:8085;ftp=127.0.0.1:8085;socks=127.0.0.1:8085";
                String exceptions = "<local>";
                String dataDir = Path.GetFullPath("chromium-data");
                BrowserContextParams contextParams = new BrowserContextParams(dataDir);
                contextParams.ProxyConfig = new CustomProxyConfig(proxyRules, exceptions);

                using (Browser browser = BrowserFactory.Create(new BrowserContext(contextParams)))
                {
                    ManualResetEvent waitEvent = new ManualResetEvent(false);
                    browser.FinishLoadingFrameEvent += delegate (object sender, FinishLoadingEventArgs e)
                    {
                        // Wait until main document of the web page is loaded completely.
                        if (e.IsMainFrame)
                        {
                            ...
                            waitEvent.Set();
                        }
                    };
                    browser.LoadURL(mainPage);
                    waitEvent.WaitOne();
                    return true;
                }
Bob
  • 11
  • 3
  • Could you please check whether the proxy is detected here: http://www.whatismyproxy.com/ ? – Anna Dolbina Nov 20 '17 at 14:42
  • Hi Anna, the proxy is a MITM proxy so I could see any traffic. Also, I looked in the user-prefs.json file it shows that the proxy setting is still set to system. – Bob Nov 21 '17 at 16:45
  • Could you please check whether this issue is specific to your particular proxy? To check this, you can configure any third-party proxy and check its visibility using the resource mentioned above. – Anna Dolbina Nov 23 '17 at 16:18
  • It is not specific to my proxy, I've tried numerous ones and even ones that require authentication. It's reading off my system proxy, it's not initializing any proxy configuration. I can set my system proxy settings and it'll work fine but I'd like to avoid that. – Bob Nov 24 '17 at 18:13
  • Is the behavior the same if you specify your proxy after creating a Browser using `Browser.Context.ProxyConfig`? Also, could you please specify the DotNetBrowser version you use? – Anna Dolbina Nov 25 '17 at 08:17
  • @AnnaDolbina I also tried Browser.Context.ProxyConfig and Im getting that error. I'm using a trial version of 1.13 I believe, whatever the latest may be. I saw that 1.14 has been pushed I'll update it. – Bob Dec 06 '17 at 01:49
  • We have recently checked proxy configuration with the HandyCache proxy server and a few public proxy servers, and everything seemed to work as expected. We have checked both passing `ProxyConfig` via `BrowserContextParams.ProxyConfig` and `Browser.Context.ProxyConfig` and found no issues with this functionality so far. – Anna Dolbina Dec 06 '17 at 10:19
  • May I see your exact implementation? Or was my implementation above incorrect? – Bob Dec 08 '17 at 08:48
  • We have used the same code to perform the check with the proxy servers that I have mentioned. – Anna Dolbina Dec 12 '17 at 06:27
  • @Bob Have you tried removing the exception "", since your proxy is a local host on 127.0.0.1, maybe DNB is blocking the proxy because you told it to not proxy local traffic ( exception) – Ibrahim D. Apr 22 '18 at 05:04
  • I'm running the latest dotnetbrowser and it fixed the issue. (1.14.2.0) Now my question is, I put an invalid proxy on purpose and it doesn't fail. Instead it just uses my local ip address to make the requests. Is this normal? – Bob Apr 27 '18 at 08:34

0 Answers0