Page 1 of 1
Proxy with TCEFUrlRequestClientComponent
Posted: Fri Sep 02, 2022 9:07 am
by TenguHaku
Hi, is there a way to use proxy list with TCEFUrlRequestClientComponent?
Re: Proxy with TCEFUrlRequestClientComponent
Posted: Fri Sep 02, 2022 6:08 pm
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.
Re: Proxy with TCEFUrlRequestClientComponent
Posted: Sun Sep 04, 2022 8:45 pm
by TenguHaku
Thank you very much, is it possible to rewrite the proxy address in CEF via internal memory?
Re: Proxy with TCEFUrlRequestClientComponent
Posted: Sun Sep 04, 2022 9:03 pm
by salvadordf
I've never tried that.