From c3aed199ad8ab350136bf8d304e224101d4b8e3e 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 --- 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 c45e5142ca753c..aaf87bb11e3aab 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)`