After the intended CefRequestContext initializes, set its proxy preference on the browser-process UI thread before starting its browsing work:

auto rule = CefDictionaryValue::Create();
rule->SetString("mode", "fixed_servers");
rule->SetString("server", "http://proxy.example:8080");

auto value = CefValue::Create();
value->SetDictionary(rule);
CefString error;
bool configured = context->SetPreference("proxy", value, error);

Check configured and keep the error on failure. CanSetPreference indicates whether the preference is user-modifiable; a startup command-line choice can lock it against this interface.

Supply that same context when creating the browser. An unused configured context does not affect a browser on the global one.

Check isolation too. Contexts may share underlying storage/network state through shared cache paths or explicit relationships. IsSharingWith is the supported way to examine that sharing. Independent proxy sessions need independently chosen contexts and storage policy.

The preference affects subsequent work; it cannot move an existing tunnel. Keep the navigation URL as the destination and the preference's server as the intermediary. For permitted public browsing with no proxy authentication configured, the HTTP proxy list can supply candidate HTTP server values. If startup switches intentionally own the route, maintain that policy rather than expecting a later preference write to override it. The supported request-context API also avoids rebuilding the removed CefProxyHandler.

Аффингæй хæстæг статьялтæ