我正在尝试使用Tor-Server作为代理HttpWebRequest,我的代码如下所示:
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();
Run Code Online (Sandbox Code Playgroud)
它与"正常"代理完美配合,但使用Tor我在调用时遇到异常
GetResponse() with Status = ServerProtocolViolation. The message is (in German...):Message = "Der Server hat eine Protokollverletzung ausgeführt.. Section=ResponseStatusLine"