Skip to content

allow user to set Proxy Modes at Runtime via Menu (autodetect / sytem, noProxy, customProxy ) #99

@blackholeearth

Description

@blackholeearth

i think, every ones has diffrent proxy setting... so we need to let them choose at menu or some place easily.

forexample i need auto-detect. it work well for most people as default..
otherwise it cant connect to google or anysite.

to do ,next step::

add this to menu.. so user can change it. so he doesnt have to restart browser...

proxyModes to be used at setPreferences::

          <option value="direct">Direct</option>
          <option value="system">System</option>
          <option value="auto_detect">Auto-Detect</option>
          <option value="pac_script">PAC Script</option>
          <option value="fixed_servers">Fixed Servers</option>

how to change proxy at runtime;


 Cef.UIThreadTaskFactory.StartNew(delegate {
      var rc = chromeBrowser.GetBrowser().GetHost().RequestContext;
      var v = new Dictionary<string, object>();
      v["mode"] = "fixed_servers";
      v["server"] = "socks5://127.0.0.1:9190";
      string error;
      bool success = rc.SetPreference("proxy", v, out error);                
    });     

sources:

https://github.com/Mojang/cef/blob/master/tests/cefclient/resources/preferences.html

cefsharp/CefSharp#1813

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions