undici
Advanced tools
Comparing version 6.14.0 to 6.14.1
@@ -26,3 +26,3 @@ # Class: Client | ||
* **keepAliveTimeout** `number | null` (optional) - Default: `4e3` - The timeout, in milliseconds, after which a socket without active requests will time out. Monitors time between activity on a connected socket. This value may be overridden by *keep-alive* hints from the server. See [MDN: HTTP - Headers - Keep-Alive directives](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Keep-Alive#directives) for more details. Defaults to 4 seconds. | ||
* **keepAliveTimeoutThreshold** `number | null` (optional) - Default: `1e3` - A number of milliseconds subtracted from server *keep-alive* hints when overriding `keepAliveTimeout` to account for timing inaccuracies caused by e.g. transport latency. Defaults to 1 second. | ||
* **keepAliveTimeoutThreshold** `number | null` (optional) - Default: `2e3` - A number of milliseconds subtracted from server *keep-alive* hints when overriding `keepAliveTimeout` to account for timing inaccuracies caused by e.g. transport latency. Defaults to 2 seconds. | ||
* **maxHeaderSize** `number | null` (optional) - Default: `--max-http-header-size` or `16384` - The maximum length of request headers in bytes. Defaults to Node.js' --max-http-header-size or 16KiB. | ||
@@ -29,0 +29,0 @@ * **maxResponseSize** `number | null` (optional) - Default: `-1` - The maximum length of response body in bytes. Set to `-1` to disable. |
@@ -7,7 +7,7 @@ # Class: EnvHttpProxyAgent | ||
EnvHttpProxyAgent automatically reads the proxy configuration from the environment variables `HTTP_PROXY`, `HTTPS_PROXY`, and `NO_PROXY` and sets up the proxy agents accordingly. When `HTTP_PROXY` and `HTTPS_PROXY` are set, `HTTP_PROXY` is used for HTTP requests and `HTTPS_PROXY` is used for HTTPS requests. If only `HTTP_PROXY` is set, `HTTP_PROXY` is used for both HTTP and HTTPS requests. If only `HTTPS_PROXY` is set, it is only used for HTTPS requests. | ||
EnvHttpProxyAgent automatically reads the proxy configuration from the environment variables `http_proxy`, `https_proxy`, and `no_proxy` and sets up the proxy agents accordingly. When `http_proxy` and `https_proxy` are set, `http_proxy` is used for HTTP requests and `https_proxy` is used for HTTPS requests. If only `http_proxy` is set, `http_proxy` is used for both HTTP and HTTPS requests. If only `https_proxy` is set, it is only used for HTTPS requests. | ||
`NO_PROXY` is a comma or space-separated list of hostnames that should not be proxied. The list may contain leading wildcard characters (`*`). If `NO_PROXY` is set, the EnvHttpProxyAgent will bypass the proxy for requests to hosts that match the list. If `NO_PROXY` is set to `"*"`, the EnvHttpProxyAgent will bypass the proxy for all requests. | ||
`no_proxy` is a comma or space-separated list of hostnames that should not be proxied. The list may contain leading wildcard characters (`*`). If `no_proxy` is set, the EnvHttpProxyAgent will bypass the proxy for requests to hosts that match the list. If `no_proxy` is set to `"*"`, the EnvHttpProxyAgent will bypass the proxy for all requests. | ||
Lower case environment variables are also supported: `http_proxy`, `https_proxy`, and `no_proxy`. However, if both the lower case and upper case environment variables are set, the lower case environment variables will be ignored. | ||
Uppercase environment variables are also supported: `HTTP_PROXY`, `HTTPS_PROXY`, and `NO_PROXY`. However, if both the lowercase and uppercase environment variables are set, the uppercase environment variables will be ignored. | ||
@@ -14,0 +14,0 @@ ## `new EnvHttpProxyAgent([options])` |
@@ -229,3 +229,3 @@ // @ts-check | ||
this[kKeepAliveMaxTimeout] = keepAliveMaxTimeout == null ? 600e3 : keepAliveMaxTimeout | ||
this[kKeepAliveTimeoutThreshold] = keepAliveTimeoutThreshold == null ? 1e3 : keepAliveTimeoutThreshold | ||
this[kKeepAliveTimeoutThreshold] = keepAliveTimeoutThreshold == null ? 2e3 : keepAliveTimeoutThreshold | ||
this[kKeepAliveTimeoutValue] = this[kKeepAliveDefaultTimeout] | ||
@@ -232,0 +232,0 @@ this[kServerName] = null |
@@ -35,3 +35,3 @@ 'use strict' | ||
const HTTP_PROXY = httpProxy ?? process.env.HTTP_PROXY ?? process.env.http_proxy | ||
const HTTP_PROXY = httpProxy ?? process.env.http_proxy ?? process.env.HTTP_PROXY | ||
if (HTTP_PROXY) { | ||
@@ -43,3 +43,3 @@ this[kHttpProxyAgent] = new ProxyAgent({ ...agentOpts, uri: HTTP_PROXY }) | ||
const HTTPS_PROXY = httpsProxy ?? process.env.HTTPS_PROXY ?? process.env.https_proxy | ||
const HTTPS_PROXY = httpsProxy ?? process.env.https_proxy ?? process.env.HTTPS_PROXY | ||
if (HTTPS_PROXY) { | ||
@@ -158,3 +158,3 @@ this[kHttpsProxyAgent] = new ProxyAgent({ ...agentOpts, uri: HTTPS_PROXY }) | ||
get #noProxyEnv () { | ||
return process.env.NO_PROXY ?? process.env.no_proxy ?? '' | ||
return process.env.no_proxy ?? process.env.NO_PROXY ?? '' | ||
} | ||
@@ -161,0 +161,0 @@ } |
'use strict' | ||
const TICK_MS = 499 | ||
let fastNow = Date.now() | ||
@@ -17,3 +19,3 @@ let fastNowTimeout | ||
if (timer.state === 0) { | ||
timer.state = fastNow + timer.delay | ||
timer.state = fastNow + timer.delay - TICK_MS | ||
} else if (timer.state > 0 && fastNow >= timer.state) { | ||
@@ -47,3 +49,3 @@ timer.state = -1 | ||
clearTimeout(fastNowTimeout) | ||
fastNowTimeout = setTimeout(onTimeout, 1e3) | ||
fastNowTimeout = setTimeout(onTimeout, TICK_MS) | ||
if (fastNowTimeout.unref) { | ||
@@ -88,3 +90,3 @@ fastNowTimeout.unref() | ||
setTimeout (callback, delay, opaque) { | ||
return delay < 1e3 | ||
return delay <= 1e3 | ||
? setTimeout(callback, delay, opaque) | ||
@@ -91,0 +93,0 @@ : new Timeout(callback, delay, opaque) |
{ | ||
"name": "undici", | ||
"version": "6.14.0", | ||
"version": "6.14.1", | ||
"description": "An HTTP/1.1 client, written from scratch for Node.js", | ||
@@ -107,3 +107,3 @@ "homepage": "https://undici.nodejs.org", | ||
"abort-controller": "^3.0.0", | ||
"borp": "^0.11.0", | ||
"borp": "^0.12.0", | ||
"c8": "^9.1.0", | ||
@@ -110,0 +110,0 @@ "cross-env": "^7.0.3", |
1106842
23273