2 ms·
My recollection from circa 2013 is that Node.js at least used to use the nginx HTTP parser, which was a horror of manually-implemented state machine written so
by chrismorgan 5y ago
My recollection from circa 2013 is that Node.js at least used to use the nginx HTTP parser, which was a horror of manually-implemented state machine written so in the name of performance, but consequently basically unmaintainable and fairly bug-riddled. And not as fast as it should have been, anyway. (The state machine approach is fine, but it should have used a lot more code generation.) It read the method byte by byte into the state machine, and baulked at unknown methods. Evidently they’ve kept that limitation, whatever they may have changed since in the parser they use (and I think nginx did eventually abandon and replace that parser entirely).
(These are my recollections from investigation I did back in 2013 when I was writing the first serious Rust HTTP library.)
- jaffathecake 5y agoWhoa, I didn't know that! But yeah, it seems like https://github.com/nodejs/http-parser https://github.com/nodejs/http-parser is based on nginx. It now uses https://github.com/nodejs/llhttp https://github.com/nodejs/llhttp but has some of the same legacy. On the other hand, deno's HTTP stuff is built on top of Hyper, a Rust library https://github.com/hyperium/hyper https://github.com/hyperium/hyper
- TechBro8615 5y agoSounds like a security researcher could have some fun comparing old nginx patches to whatever got pulled into the node codebase.