Skip to content

Instantly share code, notes, and snippets.

@russell
Created April 11, 2014 00:21
Show Gist options
  • Save russell/10433991 to your computer and use it in GitHub Desktop.
Save russell/10433991 to your computer and use it in GitHub Desktop.
The worst http server ever
# -*- coding: utf-8 -*-
import SocketServer
import SimpleHTTPServer
PORT = 8000
class HTTPServer(SimpleHTTPServer.SimpleHTTPRequestHandler):
def do_GET(self):
self.send_response(400, u"It's a Bad Request")
print "serving at port", PORT
SocketServer.TCPServer(("", PORT), HTTPServer).serve_forever()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment