HN Hall of Fame Weekly email

HTTP static server one-liners

gist.github.com Software & code Source code Software engineering Candidate
Screenshot of gist.github.com captured 2026-07-20
Page preview · captured 2026-07-20

Resurfaced independently across 7 calendar years, with breakout response in 2 of them.

submissions
8
submitters
8
observed span
2013–2021
peak thread · 95 comments
286 pts
latest 20+ return · 2021-05-13
282 pts

Submission timeline

2007–2026

One slot for every year since HN launched. Height is that year's peak points; orange marks a 100+ point or 50+ comment breakout. Select a bar to open its strongest thread.

First comments on top threads

HN comment order

I'm pushing the definition of "one liner" here, and it's got some major shortcomings (including directory traversal!), but here's one with Gnu awk: gawk '@load "filefuncs";func send(s,e,d,t,b) {;print "HTTP/1.0 "s" "e|&S;print "Content-Length: "b|&S;print"Content-Type: "t|&S;print d|&S;close(S);}func mt(f) {;c = "file -b --mime-type " f;r="";while ((c|getline z)>0) {;r=r z;} ;close(c);return r;} ;BEGIN {RS=ORS="\r\n";while(1){;S="/inet/tcp/8080/0/0";while((S|&getline l)>0) {;split(l,f,"…

tyingq·286-point thread·

The ruby one with the -run option is a bit nonintuitive in how it works. $ ruby -run -ehttpd . -p8000 The -r option requires un.rb[1] which is a file full of convenience functions, such as httpd in this example. Classic Ruby. Given that go has popularized long args with a single hyphen (-name etc), it is easy to mistake -run as an option by itself. [1] https://github.com/ruby/ruby/blob/master/lib/un.rb#L323

Just notice the difference between python2 and python3 simple http server $ python -m SimpleHTTPServer 8000 $ python3 -m http.server 8000 Even the python3 is nicer to read, I really like that they package the server in a module. It's almost twice as slower in my machine. Python2 Benchmark Requests per second: 606.03 [#/sec] (mean) Time per request: 8.250 [ms] (mean) Time per request: 1.650 [ms] (mean, across all concurrent requests) Transfer rate: 4412.05 [Kbytes/sec] received And Python3 Benchmark Requests…

The first top-level comment from each of the four biggest threads, in HN’s own order. Excerpts are shortened; open a comment for full context.

Breakout years
2

100+ points or 50+ comments

Total points
610

reference only — not used in Hall rules or ranking

Total comments
165

reference only — not used in Hall rules or ranking

Every submission

DateTitle as submittedByPointsComments
2013-06-06List of ad hoc http server one-linerswillurd20
2014-05-02List of one-liner HTTP static serversjingwen20
2014-06-22Big list of http static server one-linerssoupdiver334
2015-03-29List of HTTPD one-linersyskchu10
2016-05-03Big list of http static servers one-linersjondot10
2019-12-03One-line web servers – a long listdc35230
2020-01-18HTTP static server one-linersFirst breakout · Best threadknown28666
2021-05-13Big list of HTTP static server one-linersLatest 20+ point returnraytracer28295