4 ms·
python -m SimpleHTTPServer cannot be configured from the command line. You'll need to write an additional py script to do anything useful. It's also missing a b
by bitcoins 15y ago
python -m SimpleHTTPServer cannot be configured from the command line. You'll need to write an additional py script to do anything useful. It's also missing a bunch of features you are going to want, like AutoIndex.
It also cannot serve 6,000 requests per second out of the box.
- piotrSikora 15y agoSo is http-server supposed to be zero-configuration or configure-from-command-line server?
- bitcoin 15y agoBoth. It ships with sane defaults so you can type "http-server", but it also may optionally be configured with things like a path, a port, a host, etc.
- est 15y agoYou are both these id? http://news.ycombinator.com/user?id=bitcoin http://news.ycombinator.com/user?id=bitcoin http://news.ycombinator.com/user?id=bitcoins http://news.ycombinator.com/user?id=bitcoins
- deleted 15y ago[deleted]
- milkshakes 15y agoit's marak squires, he has lots of sock puppet accounts.
- naraktires 15y agohttp://twitter.com/#!/maraksquires/status/81591561602863104 http://twitter.com/#!/maraksquires/status/81591561602863104
- sc68cal 15y agoThat's lame. Take your downvotes and learn from them. Are you really that shallow?
- irahul 15y agoI did a `npm install http-server`. It threw me a module not found error twice - once for `eyes` and once for `colors` I ran it on a directory and tested it with `ab -n 100 -c 5 localhost:8080/`. Concurrency Level: 5 Time taken for tests: 0.046 seconds Complete requests: 100 Failed requests: 0 Write errors: 0 Total transferred: 175900 bytes HTML transferred: 149900 bytes Requests per second: 2159.97 [#/sec] (mean) Time per request: 2.315 [ms] (mean) Time per request: 0.463 [ms] (mean, across all concurrent requests) Transfer rate: 3710.33 [Kbytes/sec] received So, in my micro benchmark, it doesn't do 6000 request/second on my box. EDIT: `ab -n 15000 -c 5 localhost:8080/` is about 3000 req/s on my machine for http-server; 2200 for SimpleHTTPServer. `python - SimpleHTTPServer 8080` gave me 1800 requests/second. As far as configuration goes, for a dev server(that's what both SimpleHTTPServer and http-server are for me), the only configurations I do is to change the port. Also, it's not like http-server is a highly configurable http server and framework combined into one - I for one can live without auto-index on/off.
- bitcoin 15y agoSorry about that. Bumped to v0.1.1 and published to npm. Should fix [dist] issues. I have a feeling you need to update your npm to version 1.0 as well.
- rlpb 15y agoHowever, it is simple and it is zero-configuration - exactly your definition from your title.
- aquark 15y agoI can think of use cases for wanting a quick simple, easy to configure http server. I can think of use cases for wanting to be able to serve >1,000 requests a second. I can't think of any that fall into both categories ... am I just lacking imagination?
- unshift 15y agoonce i wanted to serve a quick and dirty page of 200 thumbnails but python's HTTP server choked after a few people tried it concurrently. it's single threaded and just wouldn't hack it. luckily if you have twisted installed, you can run "twistd web -n -p PORT --path ." it's just as easy as the basic HTTP server but way faster.
- loevborg 15y agoThis is a very good suggestion.