nodejs / http

Repository for the HTTP Working Group (Inactive)
9 stars 9 forks source link

HTTP parser support via supported JS component #12

Open jolson88 opened 8 years ago

jolson88 commented 8 years ago

(I wasn't sure whether to include this just as a comment to issue #11 or not; Mikeal asked me via email to go ahead and post this to the working group.)

Recently we (a team at Concur.com) added a feature to one of our services to support multi-part mixed posting to batch post requests. Unfortunately, we didn’t find any good support in libraries to make this possible using the Web semantics we desired. Because of this, we ended up using Node’s native HTTP parser directly using process.binding(‘http_parser’).HTTPParser. Of course there was a little learning curve since we needed to look at the native code to determine how to use properly.

Recently, we finally upgraded our code base from v0.12 to v4.2.2. As expected, there were a lot of great changes with such a version leap. A problem that we ran into was that the native HTTP parser interface also changed (not unexpected). Being a native component, it introduced very unique failures in our test suite that took some time to track down. We did get it fixed and we’re all up and running on v4.2.2.

What we would love to see is a supported JS component in Node that exposes the underlying parser for more advanced features if need be. This would not only provide an easier way to identify failures, but allow us to easily track down what changes are made and how. As this is in the core handling path of our incoming requests, we need it to be quite performant as well.