Welcome Guest Search | Active Topics | Sign In | Register

Proxy Configuration Runtime not apply Options
Minh Giang
Posted: Saturday, September 13, 2014 5:56:25 AM
Rank: Member
Groups: Member

Joined: 9/11/2014
Posts: 17
Hello eo_support!
I trying change proxy config in runtime, but not anything changing.
This's my code:
Code: C#
private void LoadNexUrl()
        {
            m_SelectedLinkIndex++;
            if (m_SelectedProxyIndex == -1)
            {
                lbProxies.SelectedIndex = m_SelectedProxyIndex = 0;
            }
            if (m_SelectedLinkIndex >= lbLinks.Items.Count)
            {
                m_SelectedLinkIndex = 0;
                m_SelectedProxyIndex++;
                if (m_SelectedProxyIndex >= lbProxies.Items.Count)
                    m_SelectedProxyIndex = 0;
                lbProxies.SelectedIndex = m_SelectedProxyIndex;
            }
            SetupProxy(lbProxies.SelectedItem.ToString());
            lbLinks.SelectedIndex = m_SelectedLinkIndex;
           
            if (tabPage1.Controls.Count > 0)
            {
                ((WebControl)tabPage1.Controls[0]).Dispose();
                tabPage1.Controls.Clear();
            }
            WebControl webControl = CreateWebControl();
            tabPage1.Controls.Add(webControl);
            webControl.WebView.Url = lbLinks.SelectedItem.ToString();
        }

private WebControl CreateWebControl()
        {
            WebControl webcontrol = new WebControl();
            webcontrol.Dock = DockStyle.Fill;
            WebView w = new WebView();
            webcontrol.WebView = w;
            w.IsLoadingChanged += new EventHandler(WebView_IsLoadingChanged);
            w.BeforeDownload += new BeforeDownloadHandler(WebView_BeforeDownload);
            w.TitleChanged += new EventHandler(WebView_TitleChanged);
            return webcontrol;
        }

private void SetupProxy(string proxy)
        {
            string[] prx = proxy.Split(':');
            if (EO.WebBrowser.Runtime.Proxy == null || EO.WebBrowser.Runtime.Proxy.HostName != prx[0])
            {
                EO.WebBrowser.Runtime.Proxy = new ProxyInfo(ProxyType.HTTP, prx[0].Trim(), int.Parse(prx[1].Trim()));
            }
        }
       private void btnStart_Click(object sender, EventArgs e)
        {
            try
            {
                LoadNexUrl();  
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }


Please help me!
eo_support
Posted: Tuesday, September 16, 2014 9:36:04 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,071
You won't be able to do that in the current version. Currently ProxyInfo can only be set once and it must be set before any WebViews are created. If you must change it, you will need to create all WebViews in a different app domain and then unload the whole app domain, or you can simply write the new setting into a configuration file and then restart your app. Sorry about it!
Minh Giang
Posted: Friday, September 19, 2014 4:29:38 PM
Rank: Member
Groups: Member

Joined: 9/11/2014
Posts: 17
Thank eo_support!
Please contact me when you resolved this problem! :)
BenjaminSimpson1989
Posted: Tuesday, January 13, 2015 8:20:00 AM
Rank: Advanced Member
Groups: Member

Joined: 1/12/2015
Posts: 81
Is there any news on when we will be able to change the ProxyInfo during runtime without having to recreate all the WebViews?
eo_support
Posted: Tuesday, January 13, 2015 10:06:35 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,071
benpm wrote:
Is there any news on when we will be able to change the ProxyInfo during runtime without having to recreate all the WebViews?


Unfortunately no. We have not implemented any changes on this regard yet. Sorry about it!
BenjaminSimpson1989
Posted: Monday, January 1, 2018 12:51:35 PM
Rank: Advanced Member
Groups: Member

Joined: 1/12/2015
Posts: 81
It looks like you've made changes to the ProxyInfo in the version since 2015 so that you can edit it for each engine. Is there any way to change proxies from one page load to the next with the same engine?
eo_support
Posted: Tuesday, January 2, 2018 7:35:42 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,071
Hi,

No. You can not change proxy from one page to the next within the same engine.

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.