我试图在 HttpWebRequest
中使用 Tor-Server 作为代理,我的代码如下所示:
HttpWebRequest request;
HttpWebResponse response;
request = (HttpWebRequest)WebRequest.Create("http://www.google.com");
request.Proxy = new WebProxy("127.0.0.1:9051");
response = (HttpWebResponse)request.GetResponse();
response.Close();
它与“普通”代理完美配合,但使用 Tor 我在调用时遇到异常
GetResponse() 状态 = ServerProtocolViolation。消息是(德语...):Message = "Der Server hat eine Protokollverletzung ausgeführt.. Section=ResponseStatusLine"
最佳答案
如果你有privoxy安装并运行你可以做
request.Proxy = new WebProxy("127.0.0.1:8118"); // default privoxy port
这将使您能够使用 tor 发出请求
关于c# - 使用 Tor 作为代理,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1962483/