from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer

class Handler(BaseHTTPRequestHandler):
  def do(self):
    self.send_response(200)
    self.wfile.write('{"headers":{"type":"type"},"content":{"b":2}}')

  def do_GET(self):
    self.do()

  def do_POST(self):
    self.do()

def main():
  try:
    server = HTTPServer(('', 8080), Handler)
    print 'started httpserver...'
    server.serve_forever()
  except KeyboardInterrupt:
    print '^C received, shutting down server'
    server.socket.close()

if __name__ == '__main__':
  main()


Add simple Python web server for performance testing
perftest: Add simple Python web server for performance testing

In order to profile bottlenecks in CCF's HTTP communication, a simple
Python webserver comes very handy. One can reason that the existing HTTP
server in CCF does not meet the performance requirements, if the
perftest client is clearly faster against the Python web server.

The web server will respond with same response despite of the request
path or request type, and can be started up with:

 > python webserver.py

Signed-off-by: Harri Salokorpi <eefb23b8deb8c30dca252cd0ae751b67337dc69f@reaktor.fi>
Signed-off-by: Karim Osman <94396faf6cc817be76165477038b3cfa832e89a4@reaktor.fi>
