title: python http handler
body: <p>I want something like <a href="http://docs.python.org/library/basehttpserver.html#BaseHTTPServer.BaseHTTPRequestHandler" rel="nofollow noreferrer"><code>BaseHTTPRequestHandler</code></a>, except that I don't want it to bind to any sockets; I want to handle the raw HTTP data to and from it myself.  Is there a good way that I can do this in Python?</p>
  
  <p>To Clarify, I want a class that receives raw TCP data from Python (NOT a socket), processes it and returns TCP data as a response (to python again).  So this class will handle TCP handshaking, and will have methods that override what I send on HTTP GET and POST, like <code>do_GET</code> and <code>do_POST</code>.  So, I want something like the Server infrastructure that already exists, except I want to pass <em>all raw TCP packets</em> in python and not through operating system sockets.  </p>