Pasando la solicitud http del servidor SOCKS

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.

preguntado el 28 de agosto de 12 a las 15:08

Is the proxy server up and running? can you use the same proxy in for example IE? -

WebClient/WebRequest classes don't support SOCKS proxy. -

Yes Erwin proxy server is running, it is accepting socket calls. -

So how to make a WCF http call to pass through SOCKS proxy server? -

0 Respuestas

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.