winhttp-proxy-resolver command line switch not working in CefSharp

104 Views Asked by At

CEF supports the command line chromium switch "--winhttp-proxy-resolver" which automatically fetches the PAC script configuration from Windows proxy settings and resolves the proxy server details. However by passing this switch to CefSharp doesn't automatically fetch the PAC script configuration from Windows proxy settings.

I tested this flag via below methods, but none of the methods are working.

settings.CefCommandLineArgs.Add("winhttp-proxy-resolver"); settings.CefCommandLineArgs.Add("winhttp-proxy-resolver", "1");

I would expect CefSharp to support all command line switches supported by CEF/Chromium.

Please advise how to use this switch in CefSharp

1

There are 1 best solutions below

0
On

I am able to resolve this and found the root cause of the issue. Our Cefsharp offscreen app runs as Windows Service under the Local System Account. In windows, proxy settings is set at account level, not at the machine level. I had to set the proxy settings in the Local system account compared to actual user account to make this chromium flag work. Also I am using the use-system-proxy-resolver instead of winhttp-proxy-resolver, as the later is deprecated and will be removed in future per the chromium documentation.

https://chromium.googlesource.com/chromium/src/+/HEAD/net/docs/proxy.md#winhttp_proxy_resolver-command-line-switch