You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: deps/undici/src/docs/docs/api/Client.md
+11-2Lines changed: 11 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,8 +17,6 @@ Returns: `Client`
17
17
18
18
### Parameter: `ClientOptions`
19
19
20
-
> ⚠️ Warning: The `H2` support is experimental.
21
-
22
20
***bodyTimeout**`number | null` (optional) - Default: `300e3` - The timeout after which a request will time out, in milliseconds. Monitors time between receiving body data. Use `0` to disable it entirely. Defaults to 300 seconds. Please note the `timeout` will be reset if you keep writing data to the socket everytime.
23
21
***headersTimeout**`number | null` (optional) - Default: `300e3` - The amount of time, in milliseconds, the parser will wait to receive the complete HTTP headers while not sending the request. Defaults to 300 seconds.
24
22
***keepAliveMaxTimeout**`number | null` (optional) - Default: `600e3` - The maximum allowed `keepAliveTimeout`, in milliseconds, when overridden by *keep-alive* hints from the server. Defaults to 10 minutes.
@@ -34,6 +32,17 @@ Returns: `Client`
34
32
***allowH2**: `boolean` - Default: `false`. Enables support for H2 if the server has assigned bigger priority to it through ALPN negotiation.
35
33
***maxConcurrentStreams**: `number` - Default: `100`. Dictates the maximum number of concurrent streams for a single H2 session. It can be overridden by a SETTINGS remote frame.
36
34
35
+
> **Notes about HTTP/2**
36
+
> - It only works under TLS connections. h2c is not supported.
37
+
> - The server must support HTTP/2 and choose it as the protocol during the ALPN negotiation.
38
+
> - The server must not have a bigger priority for HTTP/1.1 than HTTP/2.
39
+
> - Pseudo headers are automatically attached to the request. If you try to set them, they will be overwritten.
40
+
> - The `:path` header is automatically set to the request path.
41
+
> - The `:method` header is automatically set to the request method.
42
+
> - The `:scheme` header is automatically set to the request scheme.
43
+
> - The `:authority` header is automatically set to the request `host[:port]`.
44
+
> -`PUSH` frames are yet not supported.
45
+
37
46
#### Parameter: `ConnectOptions`
38
47
39
48
Every Tls option, see [here](https://nodejs.org/api/tls.html#tls_tls_connect_options_callback).
`ProxyAgent` can be configured as a global dispatcher, making it available for all requests without explicitly passing it. This simplifies code and is useful when a single proxy configuration applies to all requests.
0 commit comments