Question

I used from this code for change proxy :

 WebPreferences prefs1 = new WebPreferences();
 prefs1.ProxyConfig = proxy + ":" + port;
 session = WebCore.Sessions[dataPath] ??
     WebCore.CreateWebSession(dataPath, prefs1);

it's work perfectly when i want to create new sessions but when i try to change proxy with this code Not WORK bcs i don't create new sessions !

i don't want create new sessions and also in current sessions i can't change proxy setting or WebPreferences .....

so i want to know how can i change WebPreferences and ProxyConfig while Awesomium running...

kind regards

Was it helpful?

Solution

This question was cross-posted to http://answers.awesomium.com

For the benefit of other users, I'm documenting the cross-post's answer from Awesomium's lead developer, Perikles C. Stephanidis:

As it's been discussed in many similar posts:

  • You cannot change WebPreferences of a WebSession after the session is created.

  • You cannot change the WebSession of a view (WebControl) after the view is created. So this simply means that in order to change any of the preferences specified for a session and use them with a view, you need to create a new WebSession with the new preferences, and a new view (WebControl) that uses this new session. There is no other way.

To do this programmatically using the WinForms WebControl, see:

Using Web-Sessions - Assigning to a WebControl programmatically

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top