0

I'm trying to use webclient via a proxy. I've got the following two attempts at doing so:

 Dim wc As WebClient = New WebClient()
 wc.Proxy = New System.Net.WebProxy(proxyadd(currentprox), True)
 Dim html As String
 html = wc.DownloadString(URL)

And...

 Dim wc As WebClient = New WebClient()
 Dim prox As New WebProxy(proxyadd(currentprox))
 prox.Address = New Uri(proxyadd(currentprox))
 wc.Proxy = prox
 Dim html As String
 html = wc.DownloadString(URL)

Where proxyadd(currentprox) is an address in the form: "157.122.114.153:9000" (variable type is string).

The error I get when trying to use any proxy is:

The underlying connection was closed: An unexpected error occurred on a receive.

Any advice/help would be great. I found this list of proxies that I plan on using.

FraserOfSmeg
  • 1,128
  • 2
  • 23
  • 41
  • What's the amount of data retrieved? In addition, how long does it take, could it be a timeout? – Y.S Feb 05 '15 at 04:46
  • Also, please have a look at this post: http://stackoverflow.com/questions/21728773/the-underlying-connection-was-closed-an-unexpected-error-occurred-on-a-receiv – Y.S Feb 05 '15 at 04:48
  • The amount of data is small, I've tried it with the url of a google search and still get the issue. – FraserOfSmeg Feb 05 '15 at 05:21

0 Answers0