r/java • u/elliotbarlas • Jul 25 '22
Latest version of Microhttp, an event-driven, zero-dependency, pure-Java web server with 500 LOC, capable of 1,000,000+ requests per second on commodity EC2 hardware.
https://github.com/ebarlas/microhttp
136
Upvotes
40
u/FirstAd9893 Jul 25 '22
As currently implemented, I wouldn't recommend using this except when all clients can be trusted. The request headers are stored in an unbounded list, and so searching for headers has an O(n) cost. This makes writing DOS attacks too easy.
The server should at the very least have a header filter to avoid parsing and storing headers that won't be examined.