Skip to content

Instantly share code, notes, and snippets.

@tchn
Last active August 29, 2015 14:06
Show Gist options
  • Save tchn/7e4e92a40d535fb888d4 to your computer and use it in GitHub Desktop.
Save tchn/7e4e92a40d535fb888d4 to your computer and use it in GitHub Desktop.
python ip-bound simpleHTTPServer
#!/usr/bin/env python
import sys
import BaseHTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
# addr = ("127.0.0.1", 8888)
addr = (sys.argv[1], int(sys.argv[2]))
srv = BaseHTTPServer.HTTPServer(addr, SimpleHTTPRequestHandler)
srv.serve_forever()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment