Im trying to use WebClient.DownloadString() but using proxy. Im doing this:
WebProxy wp = new WebProxy("http://000.000.000.000:80"); (here goes real proxy ip)
WebClient wb = new WebClient();
wb.Proxy = wp;
try
{
string file = wb.DownloadString("http://google.com/");
System.Console.WriteLine(file);
}
catch (Exception e)
{
System.Console.WriteLine(e);
}
And it gives this error when DownloadString is call:
System.Net.WebException: Se ha terminado la conexion: Error inesperado de recepcion. ---> System.IO.IOException: No se puede escribir datos de en la conexion de transporte: Se ha forzado la interrupcion de una conexion existente por el host remoto. ---> System.Net.Sockets.SocketException: Se ha forzado la interrupcion de una conexion existente por el host remoto
If I don't use proxy, it works fine. The proxy also works fine, cause if I configure proxy in Chrome or Firefox, I can access any web page.
Thanks