@openclaw/proxyline 0.3.6 → 0.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/dist/connect.d.ts +9 -0
- package/dist/connect.d.ts.map +1 -1
- package/dist/connect.js +2 -2
- package/dist/node-http.d.ts.map +1 -1
- package/dist/node-http.js +16 -4
- package/package.json +4 -4
- package/src/connect.ts +2 -2
- package/src/node-http.ts +15 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.7 - 2026-08-02
|
|
4
|
+
|
|
5
|
+
- Fixed Node HTTP/HTTPS proxy agents to apply the default 30-second CONNECT timeout when callers omit a request timeout; explicit `0` remains unbounded. Thanks @SebTardif.
|
|
6
|
+
- Updated Undici and tsx, pnpm and npm release tooling, and pinned GitHub Actions to their latest stable releases.
|
|
7
|
+
|
|
3
8
|
## 0.3.6 - 2026-08-02
|
|
4
9
|
|
|
5
10
|
- Fixed HTTP forwarding through HTTPS proxies to wait for the proxy TLS handshake before assigning the socket to Node's agent. Thanks @SebTardif.
|
package/dist/connect.d.ts
CHANGED
|
@@ -13,6 +13,15 @@ export type OpenProxyConnectTunnelOptions = Readonly<{
|
|
|
13
13
|
timeoutMs?: number;
|
|
14
14
|
signal?: AbortSignal;
|
|
15
15
|
}>;
|
|
16
|
+
/** Default CONNECT handshake budget when `timeoutMs` is omitted. */
|
|
17
|
+
export declare const DEFAULT_PROXY_CONNECT_TIMEOUT_MS = 30000;
|
|
18
|
+
/**
|
|
19
|
+
* Resolve the CONNECT timeout to apply.
|
|
20
|
+
* - `undefined` → default 30s
|
|
21
|
+
* - `<= 0` → no timeout (unbounded)
|
|
22
|
+
* - positive → truncated milliseconds
|
|
23
|
+
*/
|
|
24
|
+
export declare function resolveProxyConnectTimeoutMs(timeoutMs: number | undefined): number | undefined;
|
|
16
25
|
type ProxySocket = net.Socket | tls.TLSSocket;
|
|
17
26
|
export declare function formatConnectAuthority(targetHost: string, targetPort: number): string;
|
|
18
27
|
export declare function openProxyConnectTunnel(options: OpenProxyConnectTunnelOptions): Promise<ProxySocket>;
|
package/dist/connect.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connect.d.ts","sourceRoot":"","sources":["../src/connect.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,OAAO,EAAgD,KAAK,mBAAmB,EAAqC,MAAM,aAAa,CAAC;AAExI,MAAM,MAAM,6BAA6B,GAAG,QAAQ,CAAC;IACnD,QAAQ,EAAE,MAAM,GAAG,GAAG,CAAC;IACvB,QAAQ,CAAC,EAAE,mBAAmB,CAAC;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"connect.d.ts","sourceRoot":"","sources":["../src/connect.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,OAAO,EAAgD,KAAK,mBAAmB,EAAqC,MAAM,aAAa,CAAC;AAExI,MAAM,MAAM,6BAA6B,GAAG,QAAQ,CAAC;IACnD,QAAQ,EAAE,MAAM,GAAG,GAAG,CAAC;IACvB,QAAQ,CAAC,EAAE,mBAAmB,CAAC;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,CAAC,CAAC;AAEH,oEAAoE;AACpE,eAAO,MAAM,gCAAgC,QAAS,CAAC;AAEvD;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAK9F;AAMD,KAAK,WAAW,GAAG,GAAG,CAAC,MAAM,GAAG,GAAG,CAAC,SAAS,CAAC;AAsB9C,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAqBrF;AAkDD,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,6BAA6B,GACrC,OAAO,CAAC,WAAW,CAAC,CA6HtB"}
|
package/dist/connect.js
CHANGED
|
@@ -2,14 +2,14 @@ import net from "node:net";
|
|
|
2
2
|
import tls from "node:tls";
|
|
3
3
|
import { ProxylineError, decodeProxyUserinfoComponent, redactProxyUrl, resolveProxyTlsCa } from "./shared.js";
|
|
4
4
|
/** Default CONNECT handshake budget when `timeoutMs` is omitted. */
|
|
5
|
-
const DEFAULT_PROXY_CONNECT_TIMEOUT_MS = 30_000;
|
|
5
|
+
export const DEFAULT_PROXY_CONNECT_TIMEOUT_MS = 30_000;
|
|
6
6
|
/**
|
|
7
7
|
* Resolve the CONNECT timeout to apply.
|
|
8
8
|
* - `undefined` → default 30s
|
|
9
9
|
* - `<= 0` → no timeout (unbounded)
|
|
10
10
|
* - positive → truncated milliseconds
|
|
11
11
|
*/
|
|
12
|
-
function resolveProxyConnectTimeoutMs(timeoutMs) {
|
|
12
|
+
export function resolveProxyConnectTimeoutMs(timeoutMs) {
|
|
13
13
|
if (timeoutMs === undefined) {
|
|
14
14
|
return DEFAULT_PROXY_CONNECT_TIMEOUT_MS;
|
|
15
15
|
}
|
package/dist/node-http.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-http.d.ts","sourceRoot":"","sources":["../src/node-http.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,KAAK,MAAM,YAAY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AW,QAAQ,IAAI,MAAM,CAE5B;IAED,IAAW,QAAQ,CAAC,MAAM,EAAE,MAAM,EAEjC;IAEM,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,aAAa,GAAG,MAAM,CAEvE;IAoCM,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC,aAAa,EAAE,OAAO,EAAE,uBAAuB,GAAG,IAAI,CA2BjF;IAEe,OAAO,IAAI,IAAI,CAQ9B;CACF;AAED,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,aAAa,EACvB,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,eAAe,GAAE,MAAM,GAAG,OAAgB,GACzC,uBAAuB,CAMzB;AAED,wBAAgB,qBAAqB,IAAI,uBAAuB,CAI/D;AAED,MAAM,MAAM,4BAA4B,GAAG;IACzC,GAAG,CAAC,EAAE,gBAAgB,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,QAAQ,CAAC,EAAE,mBAAmB,CAAC;CAChC,CAAC;AAMF,wBAAgB,6BAA6B,CAC3C,OAAO,GAAE,4BAAiC,GACzC,OAAO,CAIT;AAED,wBAAgB,2BAA2B,CACzC,OAAO,GAAE,4BAAiC,GACzC,uBAAuB,GAAG,SAAS,CAWrC"}
|
package/dist/node-http.js
CHANGED
|
@@ -4,7 +4,7 @@ import net from "node:net";
|
|
|
4
4
|
import tls from "node:tls";
|
|
5
5
|
import { domainToASCII } from "node:url";
|
|
6
6
|
import { readProxyEnv, resolveAmbientProxyForUrl, } from "./env.js";
|
|
7
|
-
import { formatConnectAuthority } from "./connect.js";
|
|
7
|
+
import { formatConnectAuthority, resolveProxyConnectTimeoutMs } from "./connect.js";
|
|
8
8
|
import { ProxylineError, decodeProxyUserinfoComponent, resolveProxyTlsCa } from "./shared.js";
|
|
9
9
|
const MAX_CONNECT_RESPONSE_HEADER_BYTES = 16 * 1024;
|
|
10
10
|
const INVALID_PROXY_TARGET_HOST_DELIMITER_PATTERN = /[/:?#@\\]/;
|
|
@@ -545,10 +545,22 @@ class ProxylineConnectAgent extends http.Agent {
|
|
|
545
545
|
};
|
|
546
546
|
request.setTimeout = hookedRequestSetTimeout;
|
|
547
547
|
}
|
|
548
|
+
// Prefer explicit agent/request timeout. Default 30s only when both are omitted.
|
|
549
|
+
// Explicit values go through normalizedPositiveInteger first so fractional/invalid
|
|
550
|
+
// timeouts keep the historical no-pending-timer behavior (not Math.trunc to 1ms).
|
|
548
551
|
const requestTimeout = request?.timeout;
|
|
549
|
-
const
|
|
550
|
-
if (
|
|
551
|
-
|
|
552
|
+
const rawTimeout = options.timeout !== undefined ? options.timeout : requestTimeout;
|
|
553
|
+
if (rawTimeout === undefined) {
|
|
554
|
+
const connectTimeoutMs = resolveProxyConnectTimeoutMs(undefined);
|
|
555
|
+
if (connectTimeoutMs !== undefined) {
|
|
556
|
+
startPendingTimeout(connectTimeoutMs);
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
else {
|
|
560
|
+
const timeoutMs = normalizedPositiveInteger(rawTimeout);
|
|
561
|
+
if (timeoutMs !== undefined) {
|
|
562
|
+
startPendingTimeout(timeoutMs);
|
|
563
|
+
}
|
|
552
564
|
}
|
|
553
565
|
request?.once("abort", onRequestClosed);
|
|
554
566
|
request?.once("close", onRequestClosed);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/proxyline",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.7",
|
|
4
4
|
"description": "Process-global proxy routing for Node.js.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"url": "https://github.com/openclaw/proxyline/issues"
|
|
18
18
|
},
|
|
19
19
|
"homepage": "https://proxyline.dev",
|
|
20
|
-
"packageManager": "pnpm@11.
|
|
20
|
+
"packageManager": "pnpm@11.20.0",
|
|
21
21
|
"exports": {
|
|
22
22
|
".": {
|
|
23
23
|
"types": "./dist/index.d.ts",
|
|
@@ -64,9 +64,9 @@
|
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"@types/node": "26.1.2",
|
|
66
66
|
"@types/ws": "8.18.1",
|
|
67
|
-
"tsx": "4.23.
|
|
67
|
+
"tsx": "4.23.5",
|
|
68
68
|
"typescript": "^7.0.2",
|
|
69
|
-
"undici": "8.
|
|
69
|
+
"undici": "8.10.0",
|
|
70
70
|
"ws": "8.21.1"
|
|
71
71
|
},
|
|
72
72
|
"engines": {
|
package/src/connect.ts
CHANGED
|
@@ -16,7 +16,7 @@ export type OpenProxyConnectTunnelOptions = Readonly<{
|
|
|
16
16
|
}>;
|
|
17
17
|
|
|
18
18
|
/** Default CONNECT handshake budget when `timeoutMs` is omitted. */
|
|
19
|
-
const DEFAULT_PROXY_CONNECT_TIMEOUT_MS = 30_000;
|
|
19
|
+
export const DEFAULT_PROXY_CONNECT_TIMEOUT_MS = 30_000;
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* Resolve the CONNECT timeout to apply.
|
|
@@ -24,7 +24,7 @@ const DEFAULT_PROXY_CONNECT_TIMEOUT_MS = 30_000;
|
|
|
24
24
|
* - `<= 0` → no timeout (unbounded)
|
|
25
25
|
* - positive → truncated milliseconds
|
|
26
26
|
*/
|
|
27
|
-
function resolveProxyConnectTimeoutMs(timeoutMs: number | undefined): number | undefined {
|
|
27
|
+
export function resolveProxyConnectTimeoutMs(timeoutMs: number | undefined): number | undefined {
|
|
28
28
|
if (timeoutMs === undefined) {
|
|
29
29
|
return DEFAULT_PROXY_CONNECT_TIMEOUT_MS;
|
|
30
30
|
}
|
package/src/node-http.ts
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
resolveAmbientProxyForUrl,
|
|
9
9
|
type ProxyEnvSnapshot,
|
|
10
10
|
} from "./env.js";
|
|
11
|
-
import { formatConnectAuthority } from "./connect.js";
|
|
11
|
+
import { formatConnectAuthority, resolveProxyConnectTimeoutMs } from "./connect.js";
|
|
12
12
|
import { ProxylineError, decodeProxyUserinfoComponent, resolveProxyTlsCa, type ProxylineTlsOptions } from "./shared.js";
|
|
13
13
|
import type { ProxylineSurface, ProxyResolver } from "./types.js";
|
|
14
14
|
|
|
@@ -699,10 +699,21 @@ class ProxylineConnectAgent extends http.Agent {
|
|
|
699
699
|
request.setTimeout = hookedRequestSetTimeout;
|
|
700
700
|
}
|
|
701
701
|
|
|
702
|
+
// Prefer explicit agent/request timeout. Default 30s only when both are omitted.
|
|
703
|
+
// Explicit values go through normalizedPositiveInteger first so fractional/invalid
|
|
704
|
+
// timeouts keep the historical no-pending-timer behavior (not Math.trunc to 1ms).
|
|
702
705
|
const requestTimeout = (request as { timeout?: unknown } | undefined)?.timeout;
|
|
703
|
-
const
|
|
704
|
-
if (
|
|
705
|
-
|
|
706
|
+
const rawTimeout = options.timeout !== undefined ? options.timeout : requestTimeout;
|
|
707
|
+
if (rawTimeout === undefined) {
|
|
708
|
+
const connectTimeoutMs = resolveProxyConnectTimeoutMs(undefined);
|
|
709
|
+
if (connectTimeoutMs !== undefined) {
|
|
710
|
+
startPendingTimeout(connectTimeoutMs);
|
|
711
|
+
}
|
|
712
|
+
} else {
|
|
713
|
+
const timeoutMs = normalizedPositiveInteger(rawTimeout);
|
|
714
|
+
if (timeoutMs !== undefined) {
|
|
715
|
+
startPendingTimeout(timeoutMs);
|
|
716
|
+
}
|
|
706
717
|
}
|
|
707
718
|
request?.once("abort", onRequestClosed);
|
|
708
719
|
request?.once("close", onRequestClosed);
|