4 ms·
If you have python, then these are really useful, just serves up the current directory. Python 2.x: python -m SimpleHTTPServer Python 3.x: python -m h
by WestCoastJustin 13y ago
If you have python, then these are really useful, just serves up the current directory.
Python 2.x:
python -m SimpleHTTPServer
Python 3.x:
python -m http.server 8000
- sprobertson 13y agoEasier to remember, plus Python is probably more likely to exist on a given machine than netcat.
- mikegirouard 13y agoThis is still my go-to solution, though I couldn't help but to share when I found the other solution.
- deleted 13y ago[deleted]
- gmac 13y agoOr for https (e.g. when developing for Chrome's speech recognition API): twistd --nodaemon web --path=. -c snakeoil.crt -k snakeoil.key --https=8443 And to generate a 100-year localhost key/cert for use with this: openssl genrsa -passout pass:dummy -out snakeoil.secure.key 1024 openssl rsa -passin pass:dummy -in snakeoil.secure.key -out snakeoil.key openssl req -new -subj "/commonName=localhost" -key snakeoil.key -out snakeoil.csr openssl x509 -req -days 36500 -in snakeoil.csr -signkey snakeoil.key -out snakeoil.crt
- e12e 13y agoOr: cat /etc/certs/ssl-cert-snakeoil.pem \ /etc/priv/ssl-cert-snakeoil.key >> \ /etc/priv/ssl-cert-and-key-snakeoil.pem chmod og-rwx /etc/priv/ssl-cert-and-key-snakeoil.pem #note instructions above on how to generate a fresh #self-signed cert python3 -m http.server 8000 & stunnel -p /etc/ssl/private/ssl-cert-and-key-snakeoil.pem -r 8000 -d 4430 Which does require stunnel, in addition to python, obviously.
- gmac 13y agoI can't edit my original comment now, but thought I should add this for cleanup after key/cert generation: rm snakeoil.secure.key snakeoil.csr
- Sven7 13y agoerm...chrome speech API?!? What exactly are you doing? and how can I do it too?
- gmac 13y agoI'm doing: https://github.com/jawj/pigeonsim https://github.com/jawj/pigeonsim (now with speech recognition + geocoding, supporting a beam-me-up gesture). Web speech API: http://updates.html5rocks.com/2013/01/Voice-Driven-Web-Apps-Introduction-to-the-Web-Speech-API http://updates.html5rocks.com/2013/01/Voice-Driven-Web-Apps-...
- RobAley 13y agoOr if you have PHP, there is an equivalent in 5.4 and above. http://php.net/manual/en/features.commandline.webserver.php http://php.net/manual/en/features.commandline.webserver.php