This is the summary of the third week of my Google Summer of Code project: HTTP/2 prototype server implementation in node.js.
Last week was about completing the compression code, adding logging and starting the stream implementation.
Header compression is something I've been working on for approximately a week, and now it's finally complete! I've written a blog post last week about trying it out. The compression code is not as optimized as it could be, but it's a good start. It will probably improve in the future. The progress will be tracked in this issue. After it was finalized, I've spent a sleepless night with coming up with a proposal for making the spec easier to implement.
For logging, I chose node-bunyan. It's a great logging library with JSON format output. The biggest upside of using it is that the log can be much more detailed than with other libraries (very important for debugging), while remaining easy to search and pretty printable if needed. There's a great blog post on the node.js blog about it. It is an optional dependency, so it won't burn CPU cycles when you don't want it to.
The stream code just started to arrive. Originally, I planned to write the
Connection class first, but the stream multiplexing was not that easy to implement as it seemed to, and I though implementing the
Stream first would make it easier to figure it out, so the connection code remains for this week.
As usual, the latest code is published on npm (just type
npm install http2 to install it), and the hosted version of the docs was updated as well. Feel free to open issues in the issue tracker or just email me directly if you find any problem.