Pasando la solicitud http del servidor SOCKS
Frecuentes
Visto 820 veces
1
As SOCKS proxy server can handle http requests as well along with socket requests. So I am trying to pass make http request through SOCKS proxy server, but I am not able to do that. I have successfully made socket request through SOCKS proxy server and http request through http proxy server. This is the way I made a http request through http proxy server. string sURL; sURL = textBoxWebAddress.Text;
WebRequest wrGETURL;
wrGETURL = WebRequest.Create(sURL);
WebProxy myProxy = new WebProxy(textBoxSOCKSHost.Text, int.Parse(textBoxSOCKSPort.Text));
myProxy.BypassProxyOnLocal = true;
wrGETURL.Proxy = myProxy;//WebProxy.GetDefaultProxy();
Stream objStream;
objStream = wrGETURL.GetResponse().GetResponseStream();
StreamReader objReader = new StreamReader(objStream);
string sLine = "";
int i = 0;
while (sLine != null)
{
i++;
sLine = objReader.ReadLine();
if (sLine != null)
Console.Write(sLine);
}
But when I enter address and port of SOCKS proxy server, it gives connection failure error. What I am doing wrong? Thanks.
0 Respuestas
No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas c# socks or haz tu propia pregunta.
Is the proxy server up and running? can you use the same proxy in for example IE? - Erwin
WebClient/WebRequest classes don't support SOCKS proxy. - L.B
Yes Erwin proxy server is running, it is accepting socket calls. - user1630477
So how to make a WCF http call to pass through SOCKS proxy server? - user1630477