diff --git a/doc/api/errors.md b/doc/api/errors.md index 3c65555602621a..784c9ac5a226d0 100644 --- a/doc/api/errors.md +++ b/doc/api/errors.md @@ -1137,6 +1137,11 @@ reached. An attempt was made to initiate a new push stream from within a push stream. Nested push streams are not permitted. + +### `ERR_HTTP2_NO_MEM` + +Out of memory when using the `http2session.setLocalWindowSize(windowSize)` API. + ### `ERR_HTTP2_NO_SOCKET_MANIPULATION` diff --git a/doc/api/http2.md b/doc/api/http2.md index 8df14ab04a6ba3..1272531e7147c4 100644 --- a/doc/api/http2.md +++ b/doc/api/http2.md @@ -518,6 +518,29 @@ added: v8.4.0 A prototype-less object describing the current remote settings of this `Http2Session`. The remote settings are set by the *connected* HTTP/2 peer. +#### `http2session.setLocalWindowSize(windowSize)` + + +* `windowSize` {number} + +Sets the local endpoint's window size. +The `windowSize` is the total window size to set, not +the delta. + +```js +const http2 = require('http2'); + +const server = http2.createServer(); +const expectedWindowSize = 2 ** 20; +server.on('connect', (session) => { + + // Set local window size to be 2 ** 20 + session.setLocalWindowSize(expectedWindowSize); +}); +``` + #### `http2session.setTimeout(msecs, callback)`