Page 2 of 2
Re: Proxy
Posted: Wed Apr 06, 2022 7:15 am
by pushca
Hi! My question is: can I request the "*.pac" file from the local directory next to my application?
Re: Proxy
Posted: Wed Apr 06, 2022 7:34 am
by salvadordf
I've never done that. Try using a FILE or DATA URL in GlobalWebView2Loader.ProxySettings.PacUrl.
In any case, WebView4Delphi uses the same command line switches as Chromium to configure the proxy settings.
If you find a way to configure a proxy in Chrome/Chromium with those switches then you should be able to use the same trick in WebView4Delphi.
Re: Proxy
Posted: Sun Jun 19, 2022 3:33 pm
by pushca
Hello. I use a proxy to work with the browser. My proxies require authorization. I use some solutions that handle this. Not so long ago I got experience with nodejs.js and chromium browser - there are browser commands page.authenticate(login,password). I noticed that the browser on that system and what is used here are very similar and thought that maybe there are these commands here. Could you give me a hint ?
Re: Proxy
Posted: Mon Jun 20, 2022 8:53 am
by salvadordf
The WebView2 API doesn't have any function to handle proxy settings.
For now, all we can do is use Chromium command line switches, execute JavaScript code and DevTools methods to try to find workarounds for this and any other missing API features.
I haven't tried "page.authenticate" but I guess you should be able to execute it like any other JavaScript code.
Re: Proxy
Posted: Wed Aug 28, 2024 3:41 pm
by 3vr
How do I set username and password?
I tried different formats, such as user:password@IP:PORT, but without success.
Another question, to change the proxy, is it necessary to recreate the browser every time?
Re: Proxy
Posted: Thu Aug 29, 2024 10:39 am
by salvadordf
3vr wrote: Wed Aug 28, 2024 3:41 pm
How do I set username and password?
I tried different formats, such as user:password@IP:PORT, but without success.
WebView2 doesn't have an API method to set the proxy settings and we have to use command line switches.
There's a known issue with proxy authentication :
https://github.com/MicrosoftEdge/WebView2Feedback/issues/3667
https://github.com/MicrosoftEdge/WebView2Feedback/issues/1205
https://github.com/MicrosoftEdge/WebView2Feedback/issues/132
https://github.com/MicrosoftEdge/WebView2Feedback/issues/193
https://github.com/MicrosoftEdge/WebView2Feedback/issues/120
3vr wrote: Wed Aug 28, 2024 3:41 pm
Another question, to change the proxy, is it necessary to recreate the browser every time?
At his moment, I'm afraid this is the only way.