@@ -669,10 +669,16 @@ added:
669669
670670* ` windowSize ` {number}
671671
672- Sets the local endpoint's window size.
672+ Sets the local endpoint's connection-level window size.
673673The ` windowSize ` is the total window size to set, not
674674the delta.
675675
676+ Increases take effect immediately, but decreases only apply as the window
677+ already advertised to the peer is consumed, since a window that has been
678+ advertised cannot be retracted. To use a window smaller than the default from
679+ the start of the connection, set the ` connectionWindowSize ` option when
680+ creating the server or client session instead.
681+
676682``` mjs
677683import { createServer } from ' node:http2' ;
678684
@@ -2804,6 +2810,9 @@ Throws `ERR_INVALID_ARG_TYPE` for invalid `settings` argument.
28042810<!-- YAML
28052811added: v8.4.0
28062812changes:
2813+ - version: REPLACEME
2814+ pr-url: https://github.com/nodejs/node/pull/65619
2815+ description: Added the `connectionWindowSize` option.
28072816 - version: v25.7.0
28082817 pr-url: https://github.com/nodejs/node/pull/59917
28092818 description: Added the `strictSingleValueFields` option.
@@ -2917,6 +2926,13 @@ changes:
29172926 error that should tell the peer to not open any more streams, continuing
29182927 to open streams is therefore regarded as a sign of a misbehaving peer.
29192928 ** Default:** ` 100 ` .
2929+ * ` connectionWindowSize ` {number} Sets the initial flow control window for
2930+ each session, in bytes. This is the total amount of data the remote peer
2931+ may send across all streams before it has to wait for a ` WINDOW_UPDATE ` .
2932+ The equivalent per-stream limit is ` settings.initialWindowSize ` . The
2933+ minimum allowed value is ` 1 ` and the maximum is 2<sup >31</sup >-1. Values
2934+ below 65535 will not take effect until the initial protocol-default
2935+ window of 65535 has been used.
29202936 * ` settings ` {HTTP/2 Settings Object} The initial settings to send to the
29212937 remote peer upon connection.
29222938 * ` streamResetBurst ` {number} and ` streamResetRate ` {number} Sets the rate
@@ -3028,6 +3044,9 @@ server.listen(8000);
30283044<!-- YAML
30293045added: v8.4.0
30303046changes:
3047+ - version: REPLACEME
3048+ pr-url: https://github.com/nodejs/node/pull/65619
3049+ description: Added the `connectionWindowSize` option.
30313050 - version: v25.7.0
30323051 pr-url: https://github.com/nodejs/node/pull/59917
30333052 description: Added the `strictSingleValueFields` option.
@@ -3132,6 +3151,14 @@ changes:
31323151 error that should tell the peer to not open any more streams, continuing
31333152 to open streams is therefore regarded as a sign of a misbehaving peer.
31343153 ** Default:** ` 100 ` .
3154+ * ` connectionWindowSize ` {number} Sets the initial flow control window for
3155+ each session, in bytes. This is the total amount of data the remote peer
3156+ may send across all streams before it has to wait for a ` WINDOW_UPDATE ` .
3157+ The equivalent per-stream limit is ` settings.initialWindowSize ` . The
3158+ minimum allowed value is ` 1 ` and the maximum is 2<sup >31</sup >-1. Values
3159+ below 65535 will not take effect until the initial protocol-default
3160+ window of 65535 has been used.
3161+ ** Default:** ` 65535 ` .
31353162 * ` settings ` {HTTP/2 Settings Object} The initial settings to send to the
31363163 remote peer upon connection.
31373164 * ` streamResetBurst ` {number} and ` streamResetRate ` {number} Sets the rate
@@ -3228,6 +3255,9 @@ server.listen(8443);
32283255<!-- YAML
32293256added: v8.4.0
32303257changes:
3258+ - version: REPLACEME
3259+ pr-url: https://github.com/nodejs/node/pull/65619
3260+ description: Added the `connectionWindowSize` option.
32313261 - version:
32323262 - v15.10.0
32333263 - v14.16.0
@@ -3315,6 +3345,14 @@ changes:
33153345 * ` protocol ` {string} The protocol to connect with, if not set in the
33163346 ` authority ` . Value may be either ` 'http:' ` or ` 'https:' ` . ** Default:**
33173347 ` 'https:' `
3348+ * ` connectionWindowSize ` {number} Sets the initial flow control window for
3349+ this session, in bytes. This is the total amount of data the remote peer
3350+ may send across all streams before it has to wait for a ` WINDOW_UPDATE ` .
3351+ The equivalent per-stream limit is ` settings.initialWindowSize ` . The
3352+ minimum allowed value is ` 1 ` and the maximum is 2<sup >31</sup >-1. Values
3353+ below 65535 will not take effect until the initial protocol-default
3354+ window of 65535 has been used.
3355+ ** Default:** ` 65535 ` .
33183356 * ` settings ` {HTTP/2 Settings Object} The initial settings to send to the
33193357 remote peer upon connection.
33203358 * ` remoteCustomSettings ` {Array} The array of integer values determines the
@@ -3747,6 +3785,9 @@ properties.
37473785* ` initialWindowSize ` {number} Specifies the _ sender's_ initial window size in
37483786 bytes for stream-level flow control. The minimum allowed value is 0. The
37493787 maximum allowed value is 2<sup >32</sup >-1. ** Default:** ` 65535 ` .
3788+ This is a per-stream limit; the window for the connection as a whole is
3789+ configured separately with the ` connectionWindowSize ` option of
3790+ [ ` http2.createServer() ` ] [ ] or [ ` http2.connect() ` ] [ ] .
37503791* ` maxFrameSize ` {number} Specifies the size in bytes of the largest frame
37513792 payload. The minimum allowed value is 16,384. The maximum allowed value is
37523793 2<sup >24</sup >-1. ** Default:** ` 16384 ` .
@@ -5194,6 +5235,7 @@ you need to implement any fall-back behavior yourself.
51945235[ `http.createServer()` ] : http.md#httpcreateserveroptions-requestlistener
51955236[ `http2.SecureServer` ] : #class-http2secureserver
51965237[ `http2.Server` ] : #class-http2server
5238+ [ `http2.connect()` ] : #http2connectauthority-options-listener
51975239[ `http2.createSecureServer()` ] : #http2createsecureserveroptions-onrequesthandler
51985240[ `http2.createServer()` ] : #http2createserveroptions-onrequesthandler
51995241[ `http2stream.pushStream()` ] : #http2streampushstreamheaders-options-callback
0 commit comments