@@ -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
@@ -2844,6 +2850,9 @@ Throws `ERR_INVALID_ARG_TYPE` for invalid `settings` argument.
28442850<!-- YAML
28452851added: v8.4.0
28462852changes:
2853+ - version: REPLACEME
2854+ pr-url: https://github.com/nodejs/node/pull/65619
2855+ description: Added the `connectionWindowSize` option.
28472856 - version:
28482857 - v25.7.0
28492858 - v24.15.0
@@ -2961,6 +2970,13 @@ changes:
29612970 error that should tell the peer to not open any more streams, continuing
29622971 to open streams is therefore regarded as a sign of a misbehaving peer.
29632972 ** Default:** ` 100 ` .
2973+ * ` connectionWindowSize ` {number} Sets the initial flow control window for
2974+ each session, in bytes. This is the total amount of data the remote peer
2975+ may send across all streams before it has to wait for a ` WINDOW_UPDATE ` .
2976+ The equivalent per-stream limit is ` settings.initialWindowSize ` . The
2977+ minimum allowed value is ` 1 ` and the maximum is 2<sup >31</sup >-1. Values
2978+ below 65535 will not take effect until the initial protocol-default
2979+ window of 65535 has been used.
29642980 * ` settings ` {HTTP/2 Settings Object} The initial settings to send to the
29652981 remote peer upon connection.
29662982 * ` streamResetBurst ` {number} and ` streamResetRate ` {number} Sets the rate
@@ -3072,6 +3088,9 @@ server.listen(8000);
30723088<!-- YAML
30733089added: v8.4.0
30743090changes:
3091+ - version: REPLACEME
3092+ pr-url: https://github.com/nodejs/node/pull/65619
3093+ description: Added the `connectionWindowSize` option.
30753094 - version:
30763095 - v25.7.0
30773096 - v24.15.0
@@ -3180,6 +3199,14 @@ changes:
31803199 error that should tell the peer to not open any more streams, continuing
31813200 to open streams is therefore regarded as a sign of a misbehaving peer.
31823201 ** Default:** ` 100 ` .
3202+ * ` connectionWindowSize ` {number} Sets the initial flow control window for
3203+ each session, in bytes. This is the total amount of data the remote peer
3204+ may send across all streams before it has to wait for a ` WINDOW_UPDATE ` .
3205+ The equivalent per-stream limit is ` settings.initialWindowSize ` . The
3206+ minimum allowed value is ` 1 ` and the maximum is 2<sup >31</sup >-1. Values
3207+ below 65535 will not take effect until the initial protocol-default
3208+ window of 65535 has been used.
3209+ ** Default:** ` 33554432 ` .
31833210 * ` settings ` {HTTP/2 Settings Object} The initial settings to send to the
31843211 remote peer upon connection.
31853212 * ` streamResetBurst ` {number} and ` streamResetRate ` {number} Sets the rate
@@ -3276,6 +3303,9 @@ server.listen(8443);
32763303<!-- YAML
32773304added: v8.4.0
32783305changes:
3306+ - version: REPLACEME
3307+ pr-url: https://github.com/nodejs/node/pull/65619
3308+ description: Added the `connectionWindowSize` option.
32793309 - version:
32803310 - v15.10.0
32813311 - v14.16.0
@@ -3363,6 +3393,14 @@ changes:
33633393 * ` protocol ` {string} The protocol to connect with, if not set in the
33643394 ` authority ` . Value may be either ` 'http:' ` or ` 'https:' ` . ** Default:**
33653395 ` 'https:' `
3396+ * ` connectionWindowSize ` {number} Sets the initial flow control window for
3397+ this session, in bytes. This is the total amount of data the remote peer
3398+ may send across all streams before it has to wait for a ` WINDOW_UPDATE ` .
3399+ The equivalent per-stream limit is ` settings.initialWindowSize ` . The
3400+ minimum allowed value is ` 1 ` and the maximum is 2<sup >31</sup >-1. Values
3401+ below 65535 will not take effect until the initial protocol-default
3402+ window of 65535 has been used.
3403+ ** Default:** ` 33554432 ` .
33663404 * ` settings ` {HTTP/2 Settings Object} The initial settings to send to the
33673405 remote peer upon connection.
33683406 * ` remoteCustomSettings ` {Array} The array of integer values determines the
@@ -3795,6 +3833,9 @@ properties.
37953833* ` initialWindowSize ` {number} Specifies the _ sender's_ initial window size in
37963834 bytes for stream-level flow control. The minimum allowed value is 0. The
37973835 maximum allowed value is 2<sup >32</sup >-1. ** Default:** ` 4194304 ` .
3836+ This is a per-stream limit; the window for the connection as a whole is
3837+ configured separately with the ` connectionWindowSize ` option of
3838+ [ ` http2.createServer() ` ] [ ] or [ ` http2.connect() ` ] [ ] .
37983839* ` maxFrameSize ` {number} Specifies the size in bytes of the largest frame
37993840 payload. The minimum allowed value is 16,384. The maximum allowed value is
38003841 2<sup >24</sup >-1. ** Default:** ` 16384 ` .
@@ -5258,6 +5299,7 @@ you need to implement any fall-back behavior yourself.
52585299[ `http.createServer()` ] : http.md#httpcreateserveroptions-requestlistener
52595300[ `http2.SecureServer` ] : #class-http2secureserver
52605301[ `http2.Server` ] : #class-http2server
5302+ [ `http2.connect()` ] : #http2connectauthority-options-listener
52615303[ `http2.createSecureServer()` ] : #http2createsecureserveroptions-onrequesthandler
52625304[ `http2.createServer()` ] : #http2createserveroptions-onrequesthandler
52635305[ `http2stream.pushStream()` ] : #http2streampushstreamheaders-options-callback
0 commit comments