Skip to content

Instantly share code, notes, and snippets.

@chenzx
Created May 29, 2013 03:46
Show Gist options
  • Select an option

  • Save chenzx/5667849 to your computer and use it in GitHub Desktop.

Select an option

Save chenzx/5667849 to your computer and use it in GitHub Desktop.
import SimpleHTTPServer
import BaseHTTPServer
import time
import SocketServer
import os
import threading
import socket
PORT = 8888
class MyThreadingHTTPServer(SocketServer.ThreadingTCPServer):
pass
class MySmartHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
pass
s = MyThreadingHTTPServer(("", PORT), MySmartHTTPRequestHandler)
s.serve_forever()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment