Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.

Proxy with TCEFUrlRequestClientComponent

Post Reply
TenguHaku
Posts: 4
Joined: Fri Sep 02, 2022 9:04 am

Proxy with TCEFUrlRequestClientComponent

Post by TenguHaku »

Hi, is there a way to use proxy list with TCEFUrlRequestClientComponent?
User avatar
salvadordf
Posts: 4057
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Proxy with TCEFUrlRequestClientComponent

Post by salvadordf »

Hi,

If you call TCefUrlRequestRef.New with a "nil" request context then it will use the global request context.

If you create a browser that also uses the global request context then you can set the proxy properties in that TChromiumCore component and the url request will use those proxy settings. See the MiniBrowser demo to know how to use the proxy properties.

Alternatively, if you don't create any browser then you can also use these command line switches :
  • --proxy-auto-detect
  • --proxy-bypass-list
  • --proxy-pac-url
  • --proxy-server
  • --no-proxy-server
Read these documents to know how to use those switches :
https://peter.sh/experiments/chromium-command-line-switches/
https://www.chromium.org/developers/design-documents/network-settings#TOC-Command-line-options-for-proxy-sett
https://www.linuxbabe.com/desktop-linux/configure-proxy-chromium-google-chrome-command-line

Use GlobalCEFApp.AddCustomCommandLine before the GlobalCEFApp.StartMainProcess call in the DPR file to use any command line switch.

The command line switches can only be set once before the GlobalCEFApp.StartMainProcess call and GlobalCEFApp can only be initialized once per process.

If you need to switch between several proxy settings at runtime then you need to create a browser and set the proxy setting in TChromiumCore.
TenguHaku
Posts: 4
Joined: Fri Sep 02, 2022 9:04 am

Re: Proxy with TCEFUrlRequestClientComponent

Post by TenguHaku »

Thank you very much, is it possible to rewrite the proxy address in CEF via internal memory?
User avatar
salvadordf
Posts: 4057
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Proxy with TCEFUrlRequestClientComponent

Post by salvadordf »

I've never tried that.
Post Reply