4 ms·
Kudos! I've also found it nice to have a simple http server that I can build with simple tooling (just javac and run). My single file HTTP/1.0-ish java http se
by pmayrgundter 6y ago
Kudos! I've also found it nice to have a simple http server that I can build with simple tooling (just javac and run).
My single file HTTP/1.0-ish java http server, 300 LOC:
https://github.com/pablo-mayrgundter/http https://github.com/pablo-mayrgundter/http
I use it for most of my local dev. Handles only GET requests, serving files below the directory in which the server is started. Does Content-Type inference based on file extensions (e.g. html, js, png, jpg).
Currently disables any type of cacheing as I use it mostly for local development and want to avoid versioning mistakes.
Also has fledgling SSL support that has occasionally worked.
> ./http_load -p 10 -f 100000 test.url
100000 fetches, 10 max parallel, 1.024e+09 bytes, in 34.9176
seconds
10240 mean bytes/connection
2863.88 fetches/sec, 2.93262e+07 bytes/sec
msecs/connect: 0.0995282 mean, 2.717 max, 0.037 min
msecs/first-response: 3.18724 mean, 202.23 max, 0.315 min
HTTP response codes:
code 200 -- 100000