From 01a41041d6197b243453e8d4f1ab278f3890bb2e Mon Sep 17 00:00:00 2001 From: Davy Landman Date: Wed, 6 Dec 2023 13:17:25 +0100 Subject: [PATCH] doc: improve localWindowSize event descriptions The documentation listed the wrong event to subscribe to when calling `localWindowSize`. Also properly point out the correct event for http2 clients. Fixes: https://github.com/nodejs/node/issues/51014 Refs: https://github.com/nodejs/node/issues/38426 PR-URL: https://github.com/nodejs/node/pull/51071 Reviewed-By: Luigi Pinca Reviewed-By: James M Snell --- doc/api/http2.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/api/http2.md b/doc/api/http2.md index fea6c9a39acb9f..2ec398393f6865 100644 --- a/doc/api/http2.md +++ b/doc/api/http2.md @@ -611,13 +611,15 @@ const http2 = require('node:http2'); const server = http2.createServer(); const expectedWindowSize = 2 ** 20; -server.on('connect', (session) => { +server.on('session', (session) => { // Set local window size to be 2 ** 20 session.setLocalWindowSize(expectedWindowSize); }); ``` +For http2 clients the proper event is either `'connect'` or `'remoteSettings'`. + #### `http2session.setTimeout(msecs, callback)`