I use http / https proxy like this:

HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(url); WebProxy proxy = new Webproxy(host,port); req.Proxy = proxy; HttpWebRespone res = req.GetWebResponse(); 

But with socks5 / 4, you can’t get Respone. Constantly error ("Tor is not Http proxy"). Actually the question: "which class supports working with socks5?"

Socks I take from TorBrowser.

  • curl, for example, works great with socks-proxy. And what class is there, I do not know. - Vladimir Martyanov
  • Thank you, but WebClient is not always satisfied. - 123_123
  • in ancient times, tor went with proxy polipo, which could be accessed via http. Then privoxy seemed to have come to his place, and the polypo was not found. Here to these proksy also need to be addressed. - vitidev

1 answer 1

For those who are looking for. The easiest way is to use the xNet library .

 HttpRequest req = new HttpRequest(); req.Proxy = ProxyClient.Parse(ProxyType.Socks5, "host:port"); var respone = req.Get("Https://google.com").ToString();