Setting proxy bypass list in preferences

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.

Setting proxy bypass list in preferences

Postby mgoimam » Tue Apr 19, 2016 3:37 pm

The first attempt to set proxy settings in CEF was via the command line arguments (proxy-server and proxy-bypass-list set with CefCommandLine::AppendSwitchWithValue). Both settings were taken into account but could not be changed at runtime, as expected.

In version 2, the app was updated to use the CefRequestContext::SetPreference method to allow changing the settings at runtime. Based on http://stackoverflow.com/questions/3609 ... at-runtime, the preference "proxy" was set to a dictionary with a key "mode" containing a string "fixed_servers" and a key "server" containing the proxy address. The bypass exceptions were still passed as command line arguments like in version 1. The proxy settings could now be updated at runtime, but the proxy bypass list was ignored.

In version 3, the app was updated to set the preferences according to the Chrome docs (https://developer.chrome.com/extensions/proxy). The code block below describes the structure used, "" indicates CEF strings and {} are CEF dictionaries. This way, the settings are completely ignored.

Code: Select all
proxy: {
   mode: "fixed_servers",
   rules: {
      singleProxy: {
         host: "<ADDRESS>",
         port: <PORT>,
         scheme: "socks5"
      }
   }
}


I took a look at 'libcef\browser\prefs\browser_prefs.cc' and here are my questions:

  • It seems like there is an attempt to forward the command line preferences to Chromium. Am I misunderstanding something? Shouldn't the method described in version 2 work?
  • The structure used in version 2 fits none of the official source / documentation I could find. Is there a link to official documentation somewhere that I may have missed? Failing documentation, where is this structure parsed in the source?
  • Should the preferences structure follow the ones described in the Chromium documentation? Is there a CEF specific structure?

I am using Windows 10 with CEF Branch 2623 / Chromium 49 (cef_binary_3.2623.1397.gaf139d7_windows32, latest stable on CEFBuilds.com at this time).
mgoimam
Newbie
 
Posts: 7
Joined: Mon Mar 28, 2016 10:40 am

Re: Setting proxy bypass list in preferences

Postby mgoimam » Tue Apr 19, 2016 4:37 pm

Seems like proxy settings are entirely parsed by Chromium. Source is at : https://code.google.com/p/chromium/code ... ig.cc&l=88. Still not sure why version 2 did not work, but setting preferences with the following structure worked:

Code: Select all
proxy: {
   mode: "fixed_servers",
   server: "[scheme://]hostname[:port]"
   bypass_list: "address1;address2"
}
mgoimam
Newbie
 
Posts: 7
Joined: Mon Mar 28, 2016 10:40 am


Return to Support Forum

Who is online

Users browsing this forum: Majestic-12 [Bot] and 96 guests