Skip to content

Instantly share code, notes, and snippets.

@toji
Last active April 15, 2016 18:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toji/66128d27662950e335de916bccbdb1ef to your computer and use it in GitHub Desktop.
Save toji/66128d27662950e335de916bccbdb1ef to your computer and use it in GitHub Desktop.
Local python server that only allows connections from localhost
http() {
python -c "import BaseHTTPServer as bhs, SimpleHTTPServer as shs; bhs.HTTPServer(('127.0.0.1', $1), shs.SimpleHTTPRequestHandler).serve_forever()" &
}
(Called like: "http 8000")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment