diff --git a/doc/api/http2.md b/doc/api/http2.md index 1416c976362afe..80888fe6b949d6 100644 --- a/doc/api/http2.md +++ b/doc/api/http2.md @@ -524,6 +524,33 @@ Used to set a callback function that is called when there is no activity on the `Http2Session` after `msecs` milliseconds. The given `callback` is registered as a listener on the `'timeout'` event. +#### http2session.setConnectionWindowSize(windowSize) + + +* `windowSize` {number} +* Returns: 0 if it succeeds, or one of a negative codes +In case of allocation error, a new `ERR_OUT_OF_RANGE` +error will be thrown. + +Used to set the local window size (local endpoints's window size). +The window_size is an absolute value of window size to set, rather +than the delta. + +```js +clientSession.on('connect', (session) => sendSettings(session, (s) => cb(s))); + +function sendSettings(session, cb) { + session.setConnectionWindowSize(1024*1024); + + const settings = http2.getDefaultSettings(); + settings.initialWindowSize = WINDOW_SIZE; + settings.maxFrameSize = FRAME_SIZE; +} + +``` + #### http2session.socket