I am trying to connect to a proxy server but it seems to me that it doesn’t work.
First of all , I’ll explain some stuff that I tried and then post the code.
So let’s say I create a new instance with the fallowing code
proxyclient = new ProxyClient(“124.195.18.119”,80,null,null, ProxyType.HttpConnect);
The proxy server is good because I verified it, and the aplication it’s teling me that it’s OK.
If I write this code
proxyclient = new ProxyClient(“0.0.0.0”,80,null,null, ProxyType.HttpConnect);
The aplication is telling me that it’s OK, so for any proxy valid or invalid it’s telling me that it’s ok.
So here goes the whole code:
proxyclient = new ProxyClient(“124.195.18.119”,80,null,null, ProxyType.HttpConnect);
Fetcher site;
try
{
Console.WriteLine(“Connecting with whatismyip.com
”);
proxyclient.BeginConnect(“http://whatismyip.com/
”, 80);
Console.WriteLine();
Console.Write(“Connected with whatismyip.com
using Aspose”);
site = new Fetcher(“http://whatismyip.com/
”); // It’s a class that I made
site.Save(“result.html”); // Save the web page
proxyclient.Close();
}
catch(Exception ex)
{
Console.Write(“error:” + ex.Message);
}
}
When I open the web page that I saved , I still have the same IP.
So the question is, how do I connect correctly to a proxy server and verify if the connection was successful?