Node.js AdvancedLesson 91Free preview
HTTP2 Module
This lesson is part of Node.js · All levels
Summary
This lesson discusses the built-in HTTP2 module that implements the HTTP/2 protocol. You'll understand multiplexing, header compression (HPACK), and server push that makes page loading more efficient. This module provides createSecureServer with an ALPN 'h2' and similar HTTP/1.1 API. (Node.js)
Key points
- HTTP/2 uses a single TCP connection for multiple streams at once (multiplexing).
- Header compressed with HPACK so overhead repetition is reduced.
- Node.js provides http2.createSecureServer() (https) and createServer() (h2c, rarely used on the web).
- The server allows the server to send a resource before the client requests it.
- Its API is similar to HTTP/1.1: event 'stream', stream.respond(), stream.end().
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.