Bilal Salas

Bilal Salas

  • NA
  • 21
  • 0

webproxy mission help

Jun 12 2010 6:19 PM


Hi ,I am trying to make program that take proxy and do request for the http site depending on that proxy
so if the site is bloked in my country it must not give me response or response that denote :site is blocked.
so if I changed the proxy form c# form webproxy class after that I make request that blocked site it must be avilabe corresponding to the working proxy.
but my problem is : www.youtube.com is blocked but when I make requist it response with avilabe site.!!!!
and when I open the file that contains the source code as html it opens youtube.com
so I don't know what is happen really.
although I didn't change the proxy setting .the code is as following:
                         Uri r=new Uri("http://www.youtube.com");
HttpWebRequest myWebRequest=(HttpWebRequest)WebRequest.Create(r);
HttpWebResponse myWebResponse=(HttpWebResponse)myWebRequest.GetResponse();
Stream st=myWebResponse.GetResponseStream();
StreamReader s=new StreamReader(st);
WebProxy proxy = WebProxy.GetDefaultProxy();//new WebProxy("128.232.103.203",3127);
Console.WriteLine(s.ReadToEnd());
when I ask for the currnet proxy it response as : http://localhost:4001/
string ip=myWebRequest.Proxy.GetProxy(r).ToString();

what is the problem ?? and how can I get response according to the proxy that I have set.


thanx