I am trying to use public proxy server (http://www.unblockwebnow.info/) to send HTTP request to destination site, say http://stackoverflow.com 🙂
My HTTP client has following architecture:
string url = "http://stackoverflow.com";
HttpWebRequest HttpWRequest = (HttpWebRequest)WebRequest.Create(url);
HttpWRequest.Method = "GET";
WebProxy myProxy = new WebProxy();
myProxy.Address = new Uri("http://www.unblockwebnow.info/");
HttpWRequest.Proxy = myProxy;
HttpWebResponse HttpWResponse = (HttpWebResponse)HttpWRequest.GetResponse();
StreamReader sr = new StreamReader(HttpWResponse.GetResponseStream(), encoding);
var rawHTML = sr.ReadToEnd();
sr.Close();
After executing the code for rawHTML I get "pageok -managed by puppet - hostingcms02 pageok"
If I comment out HttpWRequest.Proxy = myProxy; line, I get the site content.
This seems to work, but not with your proxy (don’t know port number for unblockwebnow.info).
Added port number after “:” in URI