CefSharp 3 set proxy at Runtime

后端 未结 4 1459
执念已碎
执念已碎 2020-12-10 17:09

I downloaded CEF (chromuim embedded framework) binary distributation that comes with (cefclient & cefsimple) c++ examples, And Realized that cefclient can change proxy s

4条回答
  •  隐瞒了意图╮
    2020-12-10 17:58

    thanks to amaitland the proper way to actively inforce changing the request-context prefrences, is to run the code on CEF UIThread as following:

        Cef.UIThreadTaskFactory.StartNew(delegate {
            var rc = this.browser.GetBrowser().GetHost().RequestContext;
            var v = new Dictionary();
            v["mode"] = "fixed_servers";
            v["server"] = "scheme://host:port";
            string error;
            bool success = rc.SetPreference("proxy", v, out error);
            //success=true,error=""
        });
    

提交回复
热议问题