Skip to content

Commit

Permalink
doc: improve localWindowSize event descriptions
Browse files Browse the repository at this point in the history
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 <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
DavyLandman authored and richardlau committed Mar 25, 2024
1 parent 15731b4 commit 01a4104
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion doc/api/http2.md
Expand Up @@ -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)`

<!-- YAML
Expand Down

0 comments on commit 01a4104

Please sign in to comment.