The HTTP parser we're using right now is built in into Node.js but it's a part of Node's public API. Relying on it potentially dangerous as it might yield different behaviors across Node.js versions.
Instead, we can use the WASM build of llhttp, which is also the HTTP parser used by Undici:
https://github.com/nodejs/undici/blob/219da8b7b3fea7e38a7644b8bc35fe6fec97d66e/lib/dispatcher/client-h1.js#L139
I've heard that Node's HTTPParser uses llhttp under the hood so, hopefully, this refactoring isn't that difficult.
The HTTP parser we're using right now is built in into Node.js but it's a part of Node's public API. Relying on it potentially dangerous as it might yield different behaviors across Node.js versions.
Instead, we can use the WASM build of
llhttp, which is also the HTTP parser used by Undici:https://github.com/nodejs/undici/blob/219da8b7b3fea7e38a7644b8bc35fe6fec97d66e/lib/dispatcher/client-h1.js#L139
I've heard that Node's
HTTPParserusesllhttpunder the hood so, hopefully, this refactoring isn't that difficult.