Skip to content

Commit 01a4104

Browse files
DavyLandmanrichardlau
authored andcommitted
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: #51014 Refs: #38426 PR-URL: #51071 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 15731b4 commit 01a4104

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

doc/api/http2.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -611,13 +611,15 @@ const http2 = require('node:http2');
611611

612612
const server = http2.createServer();
613613
const expectedWindowSize = 2 ** 20;
614-
server.on('connect', (session) => {
614+
server.on('session', (session) => {
615615

616616
// Set local window size to be 2 ** 20
617617
session.setLocalWindowSize(expectedWindowSize);
618618
});
619619
```
620620

621+
For http2 clients the proper event is either `'connect'` or `'remoteSettings'`.
622+
621623
#### `http2session.setTimeout(msecs, callback)`
622624

623625
<!-- YAML

0 commit comments

Comments
 (0)