'How to parse http messages

Im searching for a native way in node.js to parse http messages. No matter where the messages come from, a simple hard coded string or via network tcp/udp or custom Duplex streams that are treated as "sockets".

As search results i found only outdated answers with process.binding and not existing private properties/methods.

What would be the "correct" way to parse incoming http messages with build in modules?

(As comments i accept any hint/package, but the goal should be to use only build in node modules)

Thanks in advance.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source