Connectivity thru proxy servers/Wrong path to the Internet

From: Steve Podradchik (StevePodradchik_at_hotmail.com)
Date: 06/03/04


Date: Thu, 3 Jun 2004 11:24:56 -0700

Hi,

We have a commercial app that downloads data from various Web pages (not via
a Web Service, per se) and parses the data from the response. The code
below works fine most of the time but, in some corporate environments --
esp. those with Proxy servers -- the app fails to get the page. That is, it
isn't just that the app doesn't logon to the proxy but, in many cases, that,
as far as we can tell, the app makes a request using a non-existent or
non-functioning Internet connection, instead of another perfectly
functioning one on the same machine. So ... two problems and questions:

1. In cases of proxies, how do we detect and automatically use them? In
many cases, it appears that the code below fails to use them and the request
ends with an exception.

'URL is something like http://www.seattleavionics.com/

wr = CType(WebRequest.Create(URL), HttpWebRequest)
Resp = CType(wr.GetResponse(), HttpWebResponse)

2. In other cases, seemingly more likely when there is a Cisco VPN
connection (even if not active, just on the system) or the user has a
cell-phone data connection that uses Fourelle Venturi (used by Verizon's
mobile data solutions), the code above seems to simply get lost finding the
Internet and, although Internet Explorer has no trouble navigating the Web,
our app's Web requests eventually ends with a timeout. It's as if .Net
decided to use the wrong path to the Internet.

My understanding was that WebRequest would automatically use the same path
to the Internet as Internet Explorer would use. That is, we didn't have to
do anything and it should just magically work. Apparently this isn't the
case. Can someone clarify when we need to explicitly set the Proxy and when
we don't? And does anyone have any clue as to what is going on w/ #2?

Finally, does the code below look correct for manually setting a proxy?

Dim proxy As New Net.WebProxy(ProxyURL)
proxy.Credentials = New Net.NetworkCredential(Username, Password)
wr = CType(WebRequest.Create(URL), HttpWebRequest)
wr.Proxy = Proxy
Resp = CType(wr.GetResponse(), HttpWebResponse)

BTW -- If anyone is a pilot, free flight planning software for life if you
solve this one for us!

Thanks, Steve
www.seattleavionics.com



Relevant Pages

  • Connectivity thru proxy servers/Wrong path to the Internet
    ... We have a commercial app that downloads data from various Web pages (not via ... those with Proxy servers -- the app fails to get the page. ... wr = CType, HttpWebRequest) ... Internet and, although Internet Explorer has no trouble navigating the Web, ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Sharepoint app and proxy server problem
    ... World Cup games and their results...looks good...if i can get past proxy ... I am using a third part app and therefore have no access to code behind ... The app needs to connect to the internet but as I am behind a proxy ... I use ISA Server and wondering is there a way that anyone knows of to ...
    (microsoft.public.sharepoint.portalserver)
  • Re: Sharepoint app and proxy server problem
    ... The app needs to connect to the internet but as I am behind a proxy server ... I use ISA Server and wondering is there a way that anyone knows of to get ... An error occured:The request failed with HTTP status 407: Proxy ...
    (microsoft.public.sharepoint.portalserver)
  • RE: FTP Solution
    ... important thing to note is that WinInet FTP APIs do not work if Internet ... access is accomplished via CERN type proxy. ... WinInet API or add the "Proxy-Connection: ... Using FTP WinInet APIs in Visual Basic with SimpleFtp and how to enumerate ...
    (microsoft.public.vb.enterprise)
  • Re: ISA Server Problems, please help
    ... Based on the rules you have listed, SecureNAT clients should only be allowed ... The All access rule for SBS Internet Users ... Web Proxy and/or Firewall Client ... > header to the publishing server instead of the actual one. ...
    (microsoft.public.windows.server.sbs)