Page 1 of 2
Proxy
Posted: Thu Jan 13, 2022 9:59 am
by Vaytl
Hello.
Can you please tell me how to set up a proxy server for the browser?
Re: Proxy
Posted: Thu Jan 13, 2022 10:26 am
by salvadordf
The current version of WebView2 doesn't allow you to set the proxy settings so we have to use the Chromium command line switches.
GlobalWebView2Loader.ProxySettings is used to add these command line switches :
- if GlobalWebView2Loader.ProxySettings.NoProxyServer is TRUE then "--no-proxy-server" is added.
- if GlobalWebView2Loader.ProxySettings.AutoDetect is TRUE then "--proxy-auto-detect" is added.
- if you set some value to GlobalWebView2Loader.ProxySettings.Server then "--proxy-server" is added with that value.
- if you set some value to GlobalWebView2Loader.ProxySettings.ByPassList then "--proxy-bypass-list" is added with that value.
- if you set some value to GlobalWebView2Loader.ProxySettings.PacUrl then "--proxy-pac-url" is added with that value.
Read these documents for more information about those 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
Re: Proxy
Posted: Thu Jan 13, 2022 11:28 am
by Vaytl
Thanks Salvadordf.
Re: Proxy
Posted: Fri Jan 14, 2022 8:49 am
by salvadordf
Please download WebView4Delphi again from GitHub.
I just fixed an issue assigning values to the proxy settings.
Re: Proxy
Posted: Fri Jan 14, 2022 8:27 pm
by Vaytl
salvadordf wrote: Fri Jan 14, 2022 8:49 am
I just fixed an issue assigning values to the proxy settings.
Thank you.
It was possible to set the proxy server only during initialization.
It didn't work after initialization.
Maybe I'm doing something wrong?
Re: Proxy
Posted: Fri Jan 14, 2022 9:51 pm
by salvadordf
WebView2 has more limitations than CEF and at this moment we can't do that.
We can only configure it with a proxy before the GlobalWebView2Loader.StartWebView2 call.
Re: Proxy
Posted: Fri Jan 14, 2022 10:00 pm
by Vaytl
Thank you very much, Salvadordf
Re: Proxy
Posted: Sat Mar 19, 2022 4:35 pm
by pushca
Is there a chance in the future to make authorization support for a proxy?
Re: Proxy
Posted: Sat Mar 19, 2022 5:53 pm
by salvadordf
Try adding the username and password to the URL in the GlobalWebView2Loader.ProxySettings.Server property :
Code: Select all
http://<user>:<pass>@<host>:<port>/
Re: Proxy
Posted: Tue Apr 05, 2022 8:59 pm
by pushca
I'm still trying to find a way. Unfortunately, this line didn't help me. Maybe there are more ideas? I even tried to send messages via SendMessage to Webbrowser1.RenderCompHWND, but it doesn't notice any messages other than the click.