Multiplexing, streams, and server push over a single connection.
01
01
Understand the problem
nodejshttp2networkingperformance
02
02
Attempt it yourself
Sketch your approach before reading the solution — that's what interviews test.
Stuck? AI Nudge Available
Get a conceptual hint to guide your logic without spoiling the final implementation.
03
03
Study the solution
The solution is waiting
Give it an honest attempt first — then compare your thinking with the full walkthrough.
04
04
Read the code
Minimal HTTP/2 server
import http2 from 'node:http2';
import { readFileSync } from 'node:fs';
const server = http2.createSecureServer({
key: readFileSync('key.pem'), cert: readFileSync('cert.pem'),
});
server.on('stream', (stream, headers) => {
stream.respond({ ':status': 200, 'content-type': 'text/plain' });
stream.end('hello over HTTP/2');
});
server.listen(8443);05
05
Join the discussion
Discussion (0)
Sign in to join the discussion.
No responses yet. Be the first to share what you think.