Command line arguments and proxy disabling

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Command line arguments and proxy disabling

Postby Coriende » Fri Sep 11, 2015 5:30 am

I'm having a problem with CEF3 and trying to pass command line arguments 'no-proxy-server' and 'winhttp-proxy-resolver' to my client application. I've tried both: overriding OnBeforeCommandLineProcessing() and OnBeforeChildProcessLaunch() but browsing still fails with error "Could not connect to proxy server". And yes, Windows has been set to use a proxy server but these command line arguments should bypass it. Any ideas what to try next?
Coriende
Newbie
 
Posts: 6
Joined: Mon Jun 01, 2015 2:56 am

Re: Command line arguments and proxy disabling

Postby amaitland » Fri Sep 11, 2015 5:37 pm

What does your code look like?
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1292
Joined: Wed Jan 14, 2015 2:35 am

Re: Command line arguments and proxy disabling

Postby Coriende » Tue Sep 15, 2015 4:20 am

Looks like this:

Code: Select all
class CefTest : public CefApp
{
public:
   void OnBeforeCommandLineProcessing(const CefString& process_type, CefRefPtr<CefCommandLine> command_line) override
   {
      __super::OnBeforeCommandLineProcessing(process_type, command_line);
      command_line->AppendSwitch("winhttp-proxy-resolver");
      command_line->AppendSwitch("no-proxy-server");
   }

   IMPLEMENT_REFCOUNTING(CefTest);
};

class CefClientTest : public CefBrowserProcessHandler
{
   void OnBeforeChildProcessLaunch(CefRefPtr<CefCommandLine> command_line) override
   {
      __super::OnBeforeChildProcessLaunch(command_line);
      command_line->AppendSwitch("winhttp-proxy-resolver");
      command_line->AppendSwitch("no-proxy-server");
   }

   IMPLEMENT_REFCOUNTING(CefClientTest);
};


It doesn't matter if I remove the __super lines.
Coriende
Newbie
 
Posts: 6
Joined: Mon Jun 01, 2015 2:56 am

Re: Command line arguments and proxy disabling

Postby amaitland » Tue Sep 15, 2015 5:22 am

I only pass in command line arguments using `OnBeforeCommandLineProcessing`. For direct connection I've used `no-proxy-server` by it's self successfully.

Are you trying to use a `PAC` file for proxy config? It looks like that's the purpose of `winhttp-proxy-resolver`

http://peter.sh/experiments/chromium-co ... y-resolver
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1292
Joined: Wed Jan 14, 2015 2:35 am

Re: Command line arguments and proxy disabling

Postby Coriende » Thu Sep 17, 2015 1:47 am

amaitland wrote:I only pass in command line arguments using `OnBeforeCommandLineProcessing`. For direct connection I've used `no-proxy-server` by it's self successfully.

Are you trying to use a `PAC` file for proxy config? It looks like that's the purpose of `winhttp-proxy-resolver`

http://peter.sh/experiments/chromium-co ... y-resolver


I have tried this also. Only using OnBeforeCommandLineProcessing with 'no-proxy-server'. It still doesn't work.
Coriende
Newbie
 
Posts: 6
Joined: Mon Jun 01, 2015 2:56 am

Re: Command line arguments and proxy disabling

Postby amaitland » Thu Sep 17, 2015 3:45 am

I can confirm using `2454.1317` that passing `--no-proxy-server=1` works for me.

Can you try using the `cefclient` example application and passing in from the command line?
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1292
Joined: Wed Jan 14, 2015 2:35 am

Re: Command line arguments and proxy disabling

Postby Coriende » Mon Sep 21, 2015 1:12 am

amaitland wrote:I can confirm using `2454.1317` that passing `--no-proxy-server=1` works for me.

Can you try using the `cefclient` example application and passing in from the command line?


It's working now. I forgot to add the class to CefInitialize().
Coriende
Newbie
 
Posts: 6
Joined: Mon Jun 01, 2015 2:56 am


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 81 guests