The server committed a protocol violation. Section=ResponseStatusLine when using a tor proxy The server committed a protocol violation. Section=ResponseStatusLine when using a tor proxy asp.net asp.net

The server committed a protocol violation. Section=ResponseStatusLine when using a tor proxy


You can get more details about the exception you are getting which is actually a WebException by looking at the Response property of the exception and then checking the StatusDescription and StatusCode properties. That will help you get more details about the error and hopefully point you in the right direction.

Something like this:

    catch(WebException e)     {        if(e.Status == WebExceptionStatus.ProtocolError)        {            Console.WriteLine("Status Code : {0}", ((HttpWebResponse)e.Response).StatusCode);            Console.WriteLine("Status Description : {0}", ((HttpWebResponse)e.Response).StatusDescription);        }    }

Also, take a look at WebException.Status example on MSDN to get more details


I had the same problem. httpwebrequest getresponse method always return error protocol vialotion and i solved probled this way ;

first of all i use xml com object instead of xdocument or xmldocument.

this com object's have a few version Microsft XML , v3.0-v5.0-v6.0. i used v6.0.

MSXML2.DOMDocument60Class doc = new MSXML2.DOMDocument60Class();doc.setProperty("ServerHTTPRequest",true);doc.setProperty("ProhibitDTD", false); doc.async = false;doc.load(extURL);  if (doc.parseError.errorCode != 0){ // error  }else{ // do stuff}