|
Rank: Advanced Member Groups: Member
Joined: 9/20/2016 Posts: 73
|
Hi! I have a problem with proxy. I'm trying to set username and password via webView1.Engine.Options.Proxy. All is ok, but before loading page, there is a popup, asking me to fill username and password again. How I can remove this popup? Proxy and username/password are good. what i'm doing wrong? My code:
Code: C#
webView1.Engine.Options.Proxy = new EO.Base.ProxyInfo(EO.Base.ProxyType.HTTP, proxy, proxyport, username, password, BypassList);
if I put this code on event NeedCredentials, there is no popup, but why it is not working on proxy init?:
Code: C#
private void webView1_NeedCredentials(object sender, NeedCredentialsEventArgs e)
{
e.Continue(username, password);
}
|
|
Rank: Advanced Member Groups: Member
Joined: 9/20/2016 Posts: 73
|
This works only before webview init:
Code: C#
EO.WebBrowser.Runtime.Proxy = new EO.Base.ProxyInfo(EO.Base.ProxyType.HTTP, proxy, proxyport, username, password, BypassList);
How I can make the same change in current webview?
|
|
Rank: Advanced Member Groups: Member
Joined: 9/20/2016 Posts: 73
|
Finally, this works for me:
Code: C#
EO.Base.ProxyInfo proxyinfo = new EO.Base.ProxyInfo(EO.Base.ProxyType.HTTP, proxy, proxyport, username, password, BypassList);
EO.WebBrowser.Runtime.Proxy = proxyinfo;
webView1.Engine.Options.Proxy = proxyinfo;
Need to use both authorizations - on webbrowser and webview
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi, Please try to use:
Code: C#
EO.WebEngine.Engine.Default.Options.Proxy = proxyInfo;
This single line should be sufficient for you. Thanks!
|
|
Rank: Advanced Member Groups: Member
Joined: 9/20/2016 Posts: 73
|
No, if I use only this string: EO.WebEngine.Engine.Default.Options.Proxy = proxyInfo; Popup appears again.
And another problem - I can't change proxy at all, if any url already loaded in WebView (or WebView in state EO.WebEngine.EngineState.Running).
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
The proxy configuration is passed to the engine as a start up parameter. So you can not change Proxy once the engine has started. If you want to use a different proxy setting, you must restart the engine. See here for more information on how to use the engine: https://www.essentialobjects.com/doc/webbrowser/advanced/engine.aspx
|
|
Rank: Advanced Member Groups: Member
Joined: 9/20/2016 Posts: 73
|
Ok, and one more question - how to destroy current engine? Just call Engine.Stop()?
After that I try to create engine with the same name and get error that Engine already destroyed. If I use different name - all is ok.
|
|