I
I
iXelper2019-02-25 12:27:16
Chromium
iXelper, 2019-02-25 12:27:16

How to force CefSharp to load a page through a proxy?

Good afternoon, please tell me how to force CefSharp to load a page through a proxy?
My code (does not work):

string proxy = "прописываю прокси";
            CefSettings settings = new CefSettings();
            settings.CefCommandLineArgs.Add("proxy-server", proxy);
            settings.UserAgent = "My/Custom/User-Agent-AndStuff";
            Cef.Initialize(settings);

            browser = new ChromiumWebBrowser("https://2ip.ru");
            webPL.Controls.Add(browser);

What am I doing wrong? If it's not difficult, give an example code :)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
BasiC2k, 2019-05-08
@BasiC2k

Everything is done right. Working code. The proxy format should be (address:port):
string proxy = "192.168.1.1:4444";

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question