How to avoid Internet Explorer proxy settings causing Remoting problem?

Discussion in 'Microsoft Dot NET' started by harry, Jul 26, 2004.

  1. harry

    harry Guest

    Hi,

    I have a program that runs on multiple client pc's. Occasionally one or more
    of those pc's use VPN to connect to another corporate network. When using
    VPN they need to set proxy server in Internet Explorer connection settings
    (proxy:8080). However, as soon as this setting is enabled, the remoting
    program running on their pc stops communicating with the server it sends
    data to. I've disabled proxy setting on the affected pc, rebooted and my
    program commnicates with the server ok. So it appears to be the proxy
    setting.

    My questions are:

    1) Can I do anything in my program to avoid Internet Explorer proxy setting
    impacting on my program. Can I somehow have my program ignore this setting?

    2) Why does internet explorer setting cause problem with my program? I guess
    it must be system wide setting but just happens to be set in IE..well maybe
    I answer my own question here or is this incorrect? Is there .NET Framework
    network settings?

    Thanks
    Harry
     
    harry, Jul 26, 2004
    #1
    1. Advertisements

  2. harry

    Sunny Guest

    Hi,

    I assume that your program is using HTTP channels for remoting. Please,
    tell more about when this problem happens. If after the program is
    started, and you change the settings in IE? How does it stops? Do you
    use callbacks/events? What happens if you make the connection, setup the
    proxy in IE, and then start your program? Does that proxy need
    authentication?

    Sunny


    In article <#>, harry@nospam says...
    > Hi,
    >
    > I have a program that runs on multiple client pc's. Occasionally one or more
    > of those pc's use VPN to connect to another corporate network. When using
    > VPN they need to set proxy server in Internet Explorer connection settings
    > (proxy:8080). However, as soon as this setting is enabled, the remoting
    > program running on their pc stops communicating with the server it sends
    > data to. I've disabled proxy setting on the affected pc, rebooted and my
    > program commnicates with the server ok. So it appears to be the proxy
    > setting.
    >
    > My questions are:
    >
    > 1) Can I do anything in my program to avoid Internet Explorer proxy setting
    > impacting on my program. Can I somehow have my program ignore this setting?
    >
    > 2) Why does internet explorer setting cause problem with my program? I guess
    > it must be system wide setting but just happens to be set in IE..well maybe
    > I answer my own question here or is this incorrect? Is there .NET Framework
    > network settings?
    >
    > Thanks
    > Harry
    >
    >
    >
    >
     
    Sunny, Jul 26, 2004
    #2
    1. Advertisements

  3. harry

    harry Guest

    Yes. Using HTTP channel.

    If my program is started while the proxy setting is disabled, there is no
    problem.

    If my program is running, and the proxy setting is enabled (or enabled then
    disabled) still no problem with my program.

    However, if my program is started / restarted when the proxy setting is
    enabled then my program hangs when trying to communicate with the server. I
    guess because it is expecting proxy however no proxy server exists on local
    network.

    If my program was started when proxy setting was enabled, then proxy setting
    is disabled, my program still has problems communicating with server - I
    guess it still tries to use proxy server.

    I guess my only option is to temporarily disable proxy server (if enabled)
    prior to creating HTTP channel. Can I do this from VB.NET?

    Thanks
    Harry


    "Sunny" <> wrote in message
    news:...
    > Hi,
    >
    > I assume that your program is using HTTP channels for remoting. Please,
    > tell more about when this problem happens. If after the program is
    > started, and you change the settings in IE? How does it stops? Do you
    > use callbacks/events? What happens if you make the connection, setup the
    > proxy in IE, and then start your program? Does that proxy need
    > authentication?
    >
    > Sunny
    >
    >
    > In article <#>, harry@nospam says...
    > > Hi,
    > >
    > > I have a program that runs on multiple client pc's. Occasionally one or

    more
    > > of those pc's use VPN to connect to another corporate network. When

    using
    > > VPN they need to set proxy server in Internet Explorer connection

    settings
    > > (proxy:8080). However, as soon as this setting is enabled, the remoting
    > > program running on their pc stops communicating with the server it sends
    > > data to. I've disabled proxy setting on the affected pc, rebooted and my
    > > program commnicates with the server ok. So it appears to be the proxy
    > > setting.
    > >
    > > My questions are:
    > >
    > > 1) Can I do anything in my program to avoid Internet Explorer proxy

    setting
    > > impacting on my program. Can I somehow have my program ignore this

    setting?
    > >
    > > 2) Why does internet explorer setting cause problem with my program? I

    guess
    > > it must be system wide setting but just happens to be set in IE..well

    maybe
    > > I answer my own question here or is this incorrect? Is there .NET

    Framework
    > > network settings?
    > >
    > > Thanks
    > > Harry
    > >
    > >
    > >
    > >
     
    harry, Jul 27, 2004
    #3
  4. harry

    Sunny Guest

    Hi,

    In article <>, harry@nospam says...
    >
    > If my program is started while the proxy setting is disabled, there is no
    > problem.
    >
    > If my program is running, and the proxy setting is enabled (or enabled then
    > disabled) still no problem with my program.
    >
    > However, if my program is started / restarted when the proxy setting is
    > enabled then my program hangs when trying to communicate with the server. I
    > guess because it is expecting proxy however no proxy server exists on local
    > network.
    >
    > If my program was started when proxy setting was enabled, then proxy setting
    > is disabled, my program still has problems communicating with server - I
    > guess it still tries to use proxy server.


    The remoting infrastructure reads the proxy settings when channel is
    registered. That explains what you see. When you start your program
    without proxy set in IE, it registers a channel without using proxy. And
    even if you enable it later, it does not affect already registered
    channel. The same is whit when you start your program with proxy
    settings enabled.

    >
    > I guess my only option is to temporarily disable proxy server (if enabled)
    > prior to creating HTTP channel. Can I do this from VB.NET?


    It can be done. But what if your client needs a proxy to connect? I
    would put some option for this, so the user can decide if he/she needs
    the proxy settings to be used.

    If you want to disable the use of the IE settings, you have to put this
    before the channel registration:

    GlobalProxySelection.Select = GlobalProxySelection.GetEmptyWebProxy();

    Hope that helps
    Sunny
     
    Sunny, Jul 27, 2004
    #4
  5. harry

    harry Guest

    Thanks Sunny. I tried that however unfortunately the same problem still
    exists. Have you any other sugestions, or is my code incorrect?

    This code is called when loading the form:

    Private Sub CreateServerChannel()
    m_DataManager = New DataManager(Me)

    System.Net.GlobalProxySelection.Select =
    System.Net.GlobalProxySelection.GetEmptyWebProxy
    Dim chnl As New HttpChannel(3333)
    ChannelServices.RegisterChannel(chnl)

    RemotingServices.Marshal(m_DataManager, "DataManager.soap")

    End Sub

    Thanks
    Harry





    "Sunny" <> wrote in message
    news:Ox%23n5W%...
    > Hi,
    >
    > In article <>, harry@nospam says...
    > >
    > > If my program is started while the proxy setting is disabled, there is

    no
    > > problem.
    > >
    > > If my program is running, and the proxy setting is enabled (or enabled

    then
    > > disabled) still no problem with my program.
    > >
    > > However, if my program is started / restarted when the proxy setting is
    > > enabled then my program hangs when trying to communicate with the

    server. I
    > > guess because it is expecting proxy however no proxy server exists on

    local
    > > network.
    > >
    > > If my program was started when proxy setting was enabled, then proxy

    setting
    > > is disabled, my program still has problems communicating with server - I
    > > guess it still tries to use proxy server.

    >
    > The remoting infrastructure reads the proxy settings when channel is
    > registered. That explains what you see. When you start your program
    > without proxy set in IE, it registers a channel without using proxy. And
    > even if you enable it later, it does not affect already registered
    > channel. The same is whit when you start your program with proxy
    > settings enabled.
    >
    > >
    > > I guess my only option is to temporarily disable proxy server (if

    enabled)
    > > prior to creating HTTP channel. Can I do this from VB.NET?

    >
    > It can be done. But what if your client needs a proxy to connect? I
    > would put some option for this, so the user can decide if he/she needs
    > the proxy settings to be used.
    >
    > If you want to disable the use of the IE settings, you have to put this
    > before the channel registration:
    >
    > GlobalProxySelection.Select = GlobalProxySelection.GetEmptyWebProxy();
    >
    > Hope that helps
    > Sunny
     
    harry, Jul 27, 2004
    #5
  6. harry

    Sunny Guest

    Hi,
    what exception you receive?
    Is this a server code?

    This code should avoid using of any proxy.

    Your problem may be somewhere else. Can you try to explain the exact
    configuration, in which you see and don't see the problem?

    Sunny

    In article <#QqJb$#>, harry@nospam says...
    > Thanks Sunny. I tried that however unfortunately the same problem still
    > exists. Have you any other sugestions, or is my code incorrect?
    >
    > This code is called when loading the form:
    >
    > Private Sub CreateServerChannel()
    > m_DataManager = New DataManager(Me)
    >
    > System.Net.GlobalProxySelection.Select =
    > System.Net.GlobalProxySelection.GetEmptyWebProxy
    > Dim chnl As New HttpChannel(3333)
    > ChannelServices.RegisterChannel(chnl)
    >
    > RemotingServices.Marshal(m_DataManager, "DataManager.soap")
    >
    > End Sub
    >
    > Thanks
    > Harry
    >
    >
    >
    >
    >
    > "Sunny" <> wrote in message
    > news:Ox%23n5W%...
    > > Hi,
    > >
    > > In article <>, harry@nospam says...
    > > >
    > > > If my program is started while the proxy setting is disabled, there is

    > no
    > > > problem.
    > > >
    > > > If my program is running, and the proxy setting is enabled (or enabled

    > then
    > > > disabled) still no problem with my program.
    > > >
    > > > However, if my program is started / restarted when the proxy setting is
    > > > enabled then my program hangs when trying to communicate with the

    > server. I
    > > > guess because it is expecting proxy however no proxy server exists on

    > local
    > > > network.
    > > >
    > > > If my program was started when proxy setting was enabled, then proxy

    > setting
    > > > is disabled, my program still has problems communicating with server - I
    > > > guess it still tries to use proxy server.

    > >
    > > The remoting infrastructure reads the proxy settings when channel is
    > > registered. That explains what you see. When you start your program
    > > without proxy set in IE, it registers a channel without using proxy. And
    > > even if you enable it later, it does not affect already registered
    > > channel. The same is whit when you start your program with proxy
    > > settings enabled.
    > >
    > > >
    > > > I guess my only option is to temporarily disable proxy server (if

    > enabled)
    > > > prior to creating HTTP channel. Can I do this from VB.NET?

    > >
    > > It can be done. But what if your client needs a proxy to connect? I
    > > would put some option for this, so the user can decide if he/she needs
    > > the proxy settings to be used.
    > >
    > > If you want to disable the use of the IE settings, you have to put this
    > > before the channel registration:
    > >
    > > GlobalProxySelection.Select = GlobalProxySelection.GetEmptyWebProxy();
    > >
    > > Hope that helps
    > > Sunny

    >
    >
    >
     
    Sunny, Jul 27, 2004
    #6
  7. harry

    harry Guest

    Hi,

    I'm very new to, and know very little about remoting. So my explanations may
    not have all the correct remoting terminology.

    The client PC is a Windows XP pc with up to date patches, with .NET
    Framework Ver 1.1 (I use VS.NET 2002 for development). I also
    tested on another XP machine, and also a Win2000 machine. These also have
    exactly the same problem only occuring when proxy setting is enabled. I
    included the code you gave me when testing on the other pc's.

    There is no exception raised. The code simply stops/hangs, even though I
    have a timeout:
    ///
    Dim prop As IDictionary = ChannelServices.GetChannelSinkProperties(Manager)
    prop("timeout") = 2000
    ///

    The timeout works fine when the proxy is disabled and the server is shut
    down. So not only does the code appear to continue to use the proxy server
    when I insert that line of code you recommended, but it also doesn't
    timeout.

    The cause is exactly as previously explained. Absolutely nothing else
    changed except for the proxy server setting enabled in internet explorer.
    Even the checkbox labeled "Bypass proxy Server for local addresses" is also
    checked and problem still exists.

    I guess then my only remaining option is to temporarily disable proxy (if
    enabled) while registering the channel, and then re-anabling once
    registered. The time period elapsed between disabling proxy / registering
    channel / re-anbling proxy is reasonably short, therefore I doubt user will
    have an issue with it.

    Have you any alternate suggestion? Or advice in disabling/enabling proxy
    setting in code?

    Thanks for your help
    Regards
    Harry




    "Sunny" <> wrote in message
    news:OpQFuI$...
    > Hi,
    > what exception you receive?
    > Is this a server code?
    >
    > This code should avoid using of any proxy.
    >
    > Your problem may be somewhere else. Can you try to explain the exact
    > configuration, in which you see and don't see the problem?
    >
    > Sunny
    >
    > In article <#QqJb$#>, harry@nospam says...
    > > Thanks Sunny. I tried that however unfortunately the same problem still
    > > exists. Have you any other sugestions, or is my code incorrect?
    > >
    > > This code is called when loading the form:
    > >
    > > Private Sub CreateServerChannel()
    > > m_DataManager = New DataManager(Me)
    > >
    > > System.Net.GlobalProxySelection.Select =
    > > System.Net.GlobalProxySelection.GetEmptyWebProxy
    > > Dim chnl As New HttpChannel(3333)
    > > ChannelServices.RegisterChannel(chnl)
    > >
    > > RemotingServices.Marshal(m_DataManager, "DataManager.soap")
    > >
    > > End Sub
    > >
    > > Thanks
    > > Harry
    > >
    > >
    > >
    > >
    > >
    > > "Sunny" <> wrote in message
    > > news:Ox%23n5W%...
    > > > Hi,
    > > >
    > > > In article <>, harry@nospam

    says...
    > > > >
    > > > > If my program is started while the proxy setting is disabled, there

    is
    > > no
    > > > > problem.
    > > > >
    > > > > If my program is running, and the proxy setting is enabled (or

    enabled
    > > then
    > > > > disabled) still no problem with my program.
    > > > >
    > > > > However, if my program is started / restarted when the proxy setting

    is
    > > > > enabled then my program hangs when trying to communicate with the

    > > server. I
    > > > > guess because it is expecting proxy however no proxy server exists

    on
    > > local
    > > > > network.
    > > > >
    > > > > If my program was started when proxy setting was enabled, then proxy

    > > setting
    > > > > is disabled, my program still has problems communicating with

    server - I
    > > > > guess it still tries to use proxy server.
    > > >
    > > > The remoting infrastructure reads the proxy settings when channel is
    > > > registered. That explains what you see. When you start your program
    > > > without proxy set in IE, it registers a channel without using proxy.

    And
    > > > even if you enable it later, it does not affect already registered
    > > > channel. The same is whit when you start your program with proxy
    > > > settings enabled.
    > > >
    > > > >
    > > > > I guess my only option is to temporarily disable proxy server (if

    > > enabled)
    > > > > prior to creating HTTP channel. Can I do this from VB.NET?
    > > >
    > > > It can be done. But what if your client needs a proxy to connect? I
    > > > would put some option for this, so the user can decide if he/she needs
    > > > the proxy settings to be used.
    > > >
    > > > If you want to disable the use of the IE settings, you have to put

    this
    > > > before the channel registration:
    > > >
    > > > GlobalProxySelection.Select = GlobalProxySelection.GetEmptyWebProxy();
    > > >
    > > > Hope that helps
    > > > Sunny

    > >
    > >
    > >
     
    harry, Jul 28, 2004
    #7
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. 0to60
    Replies:
    1
    Views:
    153
    Ken Kolda
    Sep 20, 2004
  2. Sunny

    Automatically detect proxy settings

    Sunny, Jan 18, 2005, in forum: Microsoft Dot NET
    Replies:
    2
    Views:
    229
    Guest
    Jan 27, 2005
  3. Guest
    Replies:
    0
    Views:
    235
    Guest
    Apr 14, 2005
  4. Guest
    Replies:
    0
    Views:
    499
    Guest
    Nov 22, 2006
  5. J.P.
    Replies:
    0
    Views:
    157
Loading...

Share This Page