Skip to content

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

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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