HTTP/2 in Node.js core

November 13th, 2017

If you recall our last blogposts on HTTP/2, such as HTTP/2: a look into the future of the web, Alternatives to HTTP/2 or Optimize with Server Push and Service Workers, you may remember some of the details in the HTTP/2 protocol and the differences from version one.

The server you are talking with supports ${alpnProtocol} `); – } – – const server = http2.createSecureServer( – options, – and response handlers will work as expected, despite the fact they already have HTTP/2 extra information such as if the connection is using ALPN (used in HTTP/2 only).

HTTP/2 is starting to be used more and more (it jumped from 11% in the beginning of this year to 18% total usage on the web). If you recall our last blogposts on HTTP/2, such as HTTP/2: a look into the future of the web, Alternatives to HTTP/2 or Optimize with Server Push and Service Workers, you may remember some of the details in the HTTP/2 protocol and the differences from version one. Check them out if you have not, as we are not going into RFC details in this blogpost.

@palashv2: Playing with Node.js Core’s New Support for HTTP/2: #javascript #angularjs #100DaysOfCode…

HTTP/2 is starting to be used more and more (it jumped from 11% in the beginning of this year to 18% total usage on the web). If you recall our last blogposts on HTTP/2, such as HTTP/2: a look into the future of the web, Alternatives to HTTP/2 or Optimize with Server Push and Service Workers, you may remember some of the details in the HTTP/2 protocol and the differences from version one. Check them out if you have not, as we are not going into RFC details in this blogpost.

In our latest blogposts, we mentioned that a version of HTTP/2 was starting to be implemented under the nodejs/http2 repository, but it was not decided at the time if it was going to be merged into the Node.js core modules or if it would be an external module. The main reason behind having a new implementation was that other implementations do not fully respect the HTTP/2 RFC.

Eventually, a pull request was submitted to add it to core. It was merged and included as experimental under a flag (–expose-http2) in August (version 8.4.0).

After the Twitter announcement saying that the flag was about to be removed in 8.x LTS release, Node.js eventually got rid of the flag in version 8.8.0 (Oct, 24). HTTP/2 is still considered to be experimental and despite the fact it is still not 100% finished, you can already start experimenting…