@limrun/api 0.48.4 → 0.49.1
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 +8 -0
- package/build-settings.d.mts.map +1 -1
- package/build-settings.d.ts.map +1 -1
- package/build-settings.js +4 -5
- package/build-settings.js.map +1 -1
- package/build-settings.mjs +4 -5
- package/build-settings.mjs.map +1 -1
- package/client.d.mts +8 -5
- package/client.d.mts.map +1 -1
- package/client.d.ts +8 -5
- package/client.d.ts.map +1 -1
- package/client.js +4 -4
- package/client.js.map +1 -1
- package/client.mjs +2 -2
- package/client.mjs.map +1 -1
- package/destination-tunnel-dialer.d.mts +30 -2
- package/destination-tunnel-dialer.d.mts.map +1 -1
- package/destination-tunnel-dialer.d.ts +30 -2
- package/destination-tunnel-dialer.d.ts.map +1 -1
- package/destination-tunnel-dialer.js +349 -65
- package/destination-tunnel-dialer.js.map +1 -1
- package/destination-tunnel-dialer.mjs +345 -64
- package/destination-tunnel-dialer.mjs.map +1 -1
- package/destination-tunnel-har.d.mts +23 -0
- package/destination-tunnel-har.d.mts.map +1 -0
- package/destination-tunnel-har.d.ts +23 -0
- package/destination-tunnel-har.d.ts.map +1 -0
- package/destination-tunnel-har.js +164 -0
- package/destination-tunnel-har.js.map +1 -0
- package/destination-tunnel-har.mjs +160 -0
- package/destination-tunnel-har.mjs.map +1 -0
- package/destination-tunnel-inspection.d.mts +71 -0
- package/destination-tunnel-inspection.d.mts.map +1 -0
- package/destination-tunnel-inspection.d.ts +71 -0
- package/destination-tunnel-inspection.d.ts.map +1 -0
- package/destination-tunnel-inspection.js +267 -0
- package/destination-tunnel-inspection.js.map +1 -0
- package/destination-tunnel-inspection.mjs +261 -0
- package/destination-tunnel-inspection.mjs.map +1 -0
- package/destination-tunnel.d.mts +119 -14
- package/destination-tunnel.d.mts.map +1 -1
- package/destination-tunnel.d.ts +119 -14
- package/destination-tunnel.d.ts.map +1 -1
- package/destination-tunnel.js +407 -98
- package/destination-tunnel.js.map +1 -1
- package/destination-tunnel.mjs +374 -73
- package/destination-tunnel.mjs.map +1 -1
- package/exec-client.d.mts +9 -0
- package/exec-client.d.mts.map +1 -1
- package/exec-client.d.ts +9 -0
- package/exec-client.d.ts.map +1 -1
- package/exec-client.js.map +1 -1
- package/exec-client.mjs.map +1 -1
- package/index.d.mts +8 -1
- package/index.d.mts.map +1 -1
- package/index.d.ts +8 -1
- package/index.d.ts.map +1 -1
- package/index.js +26 -2
- package/index.js.map +1 -1
- package/index.mjs +7 -1
- package/index.mjs.map +1 -1
- package/instance-client.d.mts +107 -1
- package/instance-client.d.mts.map +1 -1
- package/instance-client.d.ts +107 -1
- package/instance-client.d.ts.map +1 -1
- package/instance-client.js +83 -1
- package/instance-client.js.map +1 -1
- package/instance-client.mjs +83 -1
- package/instance-client.mjs.map +1 -1
- package/internal/destination-tunnel-management.d.mts +4 -3
- package/internal/destination-tunnel-management.d.mts.map +1 -1
- package/internal/destination-tunnel-management.d.ts +4 -3
- package/internal/destination-tunnel-management.d.ts.map +1 -1
- package/internal/destination-tunnel-management.js +64 -46
- package/internal/destination-tunnel-management.js.map +1 -1
- package/internal/destination-tunnel-management.mjs +55 -37
- package/internal/destination-tunnel-management.mjs.map +1 -1
- package/internal/destination-tunnel-url.d.mts +2 -0
- package/internal/destination-tunnel-url.d.mts.map +1 -1
- package/internal/destination-tunnel-url.d.ts +2 -0
- package/internal/destination-tunnel-url.d.ts.map +1 -1
- package/internal/destination-tunnel-url.js +45 -5
- package/internal/destination-tunnel-url.js.map +1 -1
- package/internal/destination-tunnel-url.mjs +44 -5
- package/internal/destination-tunnel-url.mjs.map +1 -1
- package/internal/destination-tunnel-wire-reader.d.mts +23 -0
- package/internal/destination-tunnel-wire-reader.d.mts.map +1 -0
- package/internal/destination-tunnel-wire-reader.d.ts +23 -0
- package/internal/destination-tunnel-wire-reader.d.ts.map +1 -0
- package/internal/destination-tunnel-wire-reader.js +110 -0
- package/internal/destination-tunnel-wire-reader.js.map +1 -0
- package/internal/destination-tunnel-wire-reader.mjs +93 -0
- package/internal/destination-tunnel-wire-reader.mjs.map +1 -0
- package/internal/persist-option.d.mts +14 -0
- package/internal/persist-option.d.mts.map +1 -0
- package/internal/persist-option.d.ts +14 -0
- package/internal/persist-option.d.ts.map +1 -0
- package/internal/persist-option.js +18 -0
- package/internal/persist-option.js.map +1 -0
- package/internal/persist-option.mjs +15 -0
- package/internal/persist-option.mjs.map +1 -0
- package/internal/proxy-transport.d.mts +27 -0
- package/internal/proxy-transport.d.mts.map +1 -1
- package/internal/proxy-transport.d.ts +27 -0
- package/internal/proxy-transport.d.ts.map +1 -1
- package/internal/proxy-transport.js +206 -0
- package/internal/proxy-transport.js.map +1 -1
- package/internal/proxy-transport.mjs +205 -0
- package/internal/proxy-transport.mjs.map +1 -1
- package/internal/session-stream.d.mts +39 -0
- package/internal/session-stream.d.mts.map +1 -0
- package/internal/session-stream.d.ts +39 -0
- package/internal/session-stream.d.ts.map +1 -0
- package/internal/session-stream.js +144 -0
- package/internal/session-stream.js.map +1 -0
- package/internal/session-stream.mjs +139 -0
- package/internal/session-stream.mjs.map +1 -0
- package/internal/tslib.js +4 -4
- package/ios-client.d.mts +63 -4
- package/ios-client.d.mts.map +1 -1
- package/ios-client.d.ts +63 -4
- package/ios-client.d.ts.map +1 -1
- package/ios-client.js +48 -2
- package/ios-client.js.map +1 -1
- package/ios-client.mjs +48 -2
- package/ios-client.mjs.map +1 -1
- package/package.json +22 -1
- package/resources/android-instances-helpers.d.mts +25 -0
- package/resources/android-instances-helpers.d.mts.map +1 -0
- package/resources/android-instances-helpers.d.ts +25 -0
- package/resources/android-instances-helpers.d.ts.map +1 -0
- package/resources/android-instances-helpers.js +37 -0
- package/resources/android-instances-helpers.js.map +1 -0
- package/resources/android-instances-helpers.mjs +33 -0
- package/resources/android-instances-helpers.mjs.map +1 -0
- package/resources/index.d.mts +6 -3
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +6 -3
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +6 -5
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +3 -3
- package/resources/index.mjs.map +1 -1
- package/resources/ios-instances-helpers.d.mts +25 -0
- package/resources/ios-instances-helpers.d.mts.map +1 -0
- package/resources/ios-instances-helpers.d.ts +25 -0
- package/resources/ios-instances-helpers.d.ts.map +1 -0
- package/resources/ios-instances-helpers.js +37 -0
- package/resources/ios-instances-helpers.js.map +1 -0
- package/resources/ios-instances-helpers.mjs +33 -0
- package/resources/ios-instances-helpers.mjs.map +1 -0
- package/resources/session-artifacts.d.mts +70 -0
- package/resources/session-artifacts.d.mts.map +1 -0
- package/resources/session-artifacts.d.ts +70 -0
- package/resources/session-artifacts.d.ts.map +1 -0
- package/resources/session-artifacts.js +8 -0
- package/resources/session-artifacts.js.map +1 -0
- package/resources/session-artifacts.mjs +7 -0
- package/resources/session-artifacts.mjs.map +1 -0
- package/resources/xcode-instances-helpers.d.mts +55 -0
- package/resources/xcode-instances-helpers.d.mts.map +1 -1
- package/resources/xcode-instances-helpers.d.ts +55 -0
- package/resources/xcode-instances-helpers.d.ts.map +1 -1
- package/resources/xcode-instances-helpers.js +49 -3
- package/resources/xcode-instances-helpers.js.map +1 -1
- package/resources/xcode-instances-helpers.mjs +47 -2
- package/resources/xcode-instances-helpers.mjs.map +1 -1
- package/src/build-settings.ts +4 -5
- package/src/client.ts +12 -2
- package/src/destination-tunnel-dialer.ts +403 -64
- package/src/destination-tunnel-har.ts +200 -0
- package/src/destination-tunnel-inspection.ts +367 -0
- package/src/destination-tunnel.ts +510 -88
- package/src/exec-client.ts +9 -0
- package/src/index.ts +58 -0
- package/src/instance-client.ts +273 -5
- package/src/internal/destination-tunnel-management.ts +67 -43
- package/src/internal/destination-tunnel-url.ts +61 -5
- package/src/internal/destination-tunnel-wire-reader.ts +109 -0
- package/src/internal/persist-option.ts +26 -0
- package/src/internal/proxy-transport.ts +248 -0
- package/src/internal/session-stream.ts +157 -0
- package/src/ios-client.ts +129 -8
- package/src/resources/android-instances-helpers.ts +45 -0
- package/src/resources/index.ts +14 -2
- package/src/resources/ios-instances-helpers.ts +45 -0
- package/src/resources/session-artifacts.ts +95 -0
- package/src/resources/xcode-instances-helpers.ts +116 -5
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DestinationTunnelProtocolError = void 0;
|
|
4
|
+
exports.readRecord = readRecord;
|
|
5
|
+
exports.readArray = readArray;
|
|
6
|
+
exports.readString = readString;
|
|
7
|
+
exports.readNonEmptyString = readNonEmptyString;
|
|
8
|
+
exports.readBoolean = readBoolean;
|
|
9
|
+
exports.readInteger = readInteger;
|
|
10
|
+
exports.readFiniteNumber = readFiniteNumber;
|
|
11
|
+
exports.readSafeNonNegativeInteger = readSafeNonNegativeInteger;
|
|
12
|
+
exports.readOptionalString = readOptionalString;
|
|
13
|
+
exports.readOptionalBoolean = readOptionalBoolean;
|
|
14
|
+
exports.readOptionalNonNegativeInteger = readOptionalNonNegativeInteger;
|
|
15
|
+
exports.decodeUtf8 = decodeUtf8;
|
|
16
|
+
exports.toBuffer = toBuffer;
|
|
17
|
+
class DestinationTunnelProtocolError extends Error {
|
|
18
|
+
constructor(message) {
|
|
19
|
+
super(message);
|
|
20
|
+
this.name = 'DestinationTunnelProtocolError';
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.DestinationTunnelProtocolError = DestinationTunnelProtocolError;
|
|
24
|
+
function readRecord(value, name) {
|
|
25
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value)) {
|
|
26
|
+
throw new DestinationTunnelProtocolError(`${name} must be an object`);
|
|
27
|
+
}
|
|
28
|
+
return value;
|
|
29
|
+
}
|
|
30
|
+
function readArray(record, key) {
|
|
31
|
+
const value = record[key];
|
|
32
|
+
if (!Array.isArray(value)) {
|
|
33
|
+
throw new DestinationTunnelProtocolError(`${key} must be an array`);
|
|
34
|
+
}
|
|
35
|
+
return value;
|
|
36
|
+
}
|
|
37
|
+
function readString(record, key) {
|
|
38
|
+
const value = record[key];
|
|
39
|
+
if (typeof value !== 'string') {
|
|
40
|
+
throw new DestinationTunnelProtocolError(`${key} must be a string`);
|
|
41
|
+
}
|
|
42
|
+
return value;
|
|
43
|
+
}
|
|
44
|
+
function readNonEmptyString(record, key) {
|
|
45
|
+
const value = readString(record, key);
|
|
46
|
+
if (value.length === 0) {
|
|
47
|
+
throw new DestinationTunnelProtocolError(`${key} must not be empty`);
|
|
48
|
+
}
|
|
49
|
+
return value;
|
|
50
|
+
}
|
|
51
|
+
function readBoolean(record, key) {
|
|
52
|
+
const value = record[key];
|
|
53
|
+
if (typeof value !== 'boolean') {
|
|
54
|
+
throw new DestinationTunnelProtocolError(`${key} must be a boolean`);
|
|
55
|
+
}
|
|
56
|
+
return value;
|
|
57
|
+
}
|
|
58
|
+
function readInteger(record, key) {
|
|
59
|
+
const value = record[key];
|
|
60
|
+
if (!Number.isInteger(value)) {
|
|
61
|
+
throw new DestinationTunnelProtocolError(`${key} must be an integer`);
|
|
62
|
+
}
|
|
63
|
+
return value;
|
|
64
|
+
}
|
|
65
|
+
function readFiniteNumber(record, key) {
|
|
66
|
+
const value = record[key];
|
|
67
|
+
if (typeof value !== 'number' || !Number.isFinite(value)) {
|
|
68
|
+
throw new DestinationTunnelProtocolError(`${key} must be a finite number`);
|
|
69
|
+
}
|
|
70
|
+
return value;
|
|
71
|
+
}
|
|
72
|
+
function readSafeNonNegativeInteger(value, name) {
|
|
73
|
+
if (!Number.isSafeInteger(value) || value < 0) {
|
|
74
|
+
throw new DestinationTunnelProtocolError(`${name} must be a safe non-negative integer`);
|
|
75
|
+
}
|
|
76
|
+
return value;
|
|
77
|
+
}
|
|
78
|
+
function readOptionalString(record, key) {
|
|
79
|
+
return record[key] === undefined ? {} : { [key]: readString(record, key) };
|
|
80
|
+
}
|
|
81
|
+
function readOptionalBoolean(record, key) {
|
|
82
|
+
return record[key] === undefined ? {} : { [key]: readBoolean(record, key) };
|
|
83
|
+
}
|
|
84
|
+
function readOptionalNonNegativeInteger(record, key) {
|
|
85
|
+
const value = record[key];
|
|
86
|
+
if (value === undefined)
|
|
87
|
+
return {};
|
|
88
|
+
if (!Number.isInteger(value) || value < 0) {
|
|
89
|
+
throw new DestinationTunnelProtocolError(`${key} must be a non-negative integer`);
|
|
90
|
+
}
|
|
91
|
+
return { [key]: value };
|
|
92
|
+
}
|
|
93
|
+
function decodeUtf8(value, name) {
|
|
94
|
+
try {
|
|
95
|
+
return new TextDecoder('utf-8', { fatal: true }).decode(value);
|
|
96
|
+
}
|
|
97
|
+
catch {
|
|
98
|
+
throw new DestinationTunnelProtocolError(`${name} must be valid UTF-8`);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
function toBuffer(data) {
|
|
102
|
+
if (Buffer.isBuffer(data))
|
|
103
|
+
return data;
|
|
104
|
+
if (Array.isArray(data))
|
|
105
|
+
return Buffer.concat(data);
|
|
106
|
+
if (data instanceof ArrayBuffer)
|
|
107
|
+
return Buffer.from(data);
|
|
108
|
+
throw new DestinationTunnelProtocolError('unsupported WebSocket payload type');
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=destination-tunnel-wire-reader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"destination-tunnel-wire-reader.js","sourceRoot":"","sources":["../src/internal/destination-tunnel-wire-reader.ts"],"names":[],"mappings":";;;AAOA,gCAKC;AAED,8BAMC;AAED,gCAMC;AAED,gDAMC;AAED,kCAMC;AAED,kCAMC;AAED,4CAMC;AAED,gEAKC;AAED,gDAKC;AAED,kDAKC;AAED,wEAUC;AAED,gCAMC;AAED,4BAKC;AA5GD,MAAa,8BAA+B,SAAQ,KAAK;IACvD,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO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AI,CAAC,CAAC;IAC1D,MAAM,IAAI,8BAA8B,CAAC,oCAAoC,CAAC,CAAC;AACjF,CAAC"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
export class DestinationTunnelProtocolError extends Error {
|
|
2
|
+
constructor(message) {
|
|
3
|
+
super(message);
|
|
4
|
+
this.name = 'DestinationTunnelProtocolError';
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
export function readRecord(value, name) {
|
|
8
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value)) {
|
|
9
|
+
throw new DestinationTunnelProtocolError(`${name} must be an object`);
|
|
10
|
+
}
|
|
11
|
+
return value;
|
|
12
|
+
}
|
|
13
|
+
export function readArray(record, key) {
|
|
14
|
+
const value = record[key];
|
|
15
|
+
if (!Array.isArray(value)) {
|
|
16
|
+
throw new DestinationTunnelProtocolError(`${key} must be an array`);
|
|
17
|
+
}
|
|
18
|
+
return value;
|
|
19
|
+
}
|
|
20
|
+
export function readString(record, key) {
|
|
21
|
+
const value = record[key];
|
|
22
|
+
if (typeof value !== 'string') {
|
|
23
|
+
throw new DestinationTunnelProtocolError(`${key} must be a string`);
|
|
24
|
+
}
|
|
25
|
+
return value;
|
|
26
|
+
}
|
|
27
|
+
export function readNonEmptyString(record, key) {
|
|
28
|
+
const value = readString(record, key);
|
|
29
|
+
if (value.length === 0) {
|
|
30
|
+
throw new DestinationTunnelProtocolError(`${key} must not be empty`);
|
|
31
|
+
}
|
|
32
|
+
return value;
|
|
33
|
+
}
|
|
34
|
+
export function readBoolean(record, key) {
|
|
35
|
+
const value = record[key];
|
|
36
|
+
if (typeof value !== 'boolean') {
|
|
37
|
+
throw new DestinationTunnelProtocolError(`${key} must be a boolean`);
|
|
38
|
+
}
|
|
39
|
+
return value;
|
|
40
|
+
}
|
|
41
|
+
export function readInteger(record, key) {
|
|
42
|
+
const value = record[key];
|
|
43
|
+
if (!Number.isInteger(value)) {
|
|
44
|
+
throw new DestinationTunnelProtocolError(`${key} must be an integer`);
|
|
45
|
+
}
|
|
46
|
+
return value;
|
|
47
|
+
}
|
|
48
|
+
export function readFiniteNumber(record, key) {
|
|
49
|
+
const value = record[key];
|
|
50
|
+
if (typeof value !== 'number' || !Number.isFinite(value)) {
|
|
51
|
+
throw new DestinationTunnelProtocolError(`${key} must be a finite number`);
|
|
52
|
+
}
|
|
53
|
+
return value;
|
|
54
|
+
}
|
|
55
|
+
export function readSafeNonNegativeInteger(value, name) {
|
|
56
|
+
if (!Number.isSafeInteger(value) || value < 0) {
|
|
57
|
+
throw new DestinationTunnelProtocolError(`${name} must be a safe non-negative integer`);
|
|
58
|
+
}
|
|
59
|
+
return value;
|
|
60
|
+
}
|
|
61
|
+
export function readOptionalString(record, key) {
|
|
62
|
+
return record[key] === undefined ? {} : { [key]: readString(record, key) };
|
|
63
|
+
}
|
|
64
|
+
export function readOptionalBoolean(record, key) {
|
|
65
|
+
return record[key] === undefined ? {} : { [key]: readBoolean(record, key) };
|
|
66
|
+
}
|
|
67
|
+
export function readOptionalNonNegativeInteger(record, key) {
|
|
68
|
+
const value = record[key];
|
|
69
|
+
if (value === undefined)
|
|
70
|
+
return {};
|
|
71
|
+
if (!Number.isInteger(value) || value < 0) {
|
|
72
|
+
throw new DestinationTunnelProtocolError(`${key} must be a non-negative integer`);
|
|
73
|
+
}
|
|
74
|
+
return { [key]: value };
|
|
75
|
+
}
|
|
76
|
+
export function decodeUtf8(value, name) {
|
|
77
|
+
try {
|
|
78
|
+
return new TextDecoder('utf-8', { fatal: true }).decode(value);
|
|
79
|
+
}
|
|
80
|
+
catch {
|
|
81
|
+
throw new DestinationTunnelProtocolError(`${name} must be valid UTF-8`);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
export function toBuffer(data) {
|
|
85
|
+
if (Buffer.isBuffer(data))
|
|
86
|
+
return data;
|
|
87
|
+
if (Array.isArray(data))
|
|
88
|
+
return Buffer.concat(data);
|
|
89
|
+
if (data instanceof ArrayBuffer)
|
|
90
|
+
return Buffer.from(data);
|
|
91
|
+
throw new DestinationTunnelProtocolError('unsupported WebSocket payload type');
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=destination-tunnel-wire-reader.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"destination-tunnel-wire-reader.mjs","sourceRoot":"","sources":["../src/internal/destination-tunnel-wire-reader.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,8BAA+B,SAAQ,KAAK;IACvD,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,gCAAgC,CAAC;IAC/C,CAAC;CACF;AAED,MAAM,UAAU,UAAU,CAAC,KAAc,EAAE,IAAY;IACrD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACxE,MAAM,IAAI,8BAA8B,CAAC,GAAG,IAAI,oBAAoB,CAAC,CAAC;IACxE,CAAC;IACD,OAAO,KAAgC,CAAC;AAC1C,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,MAA+B,EAAE,GAAW;IACpE,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IAC1B,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,8BAA8B,CAAC,GAAG,GAAG,mBAAmB,CAAC,CAAC;IACtE,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,MAA+B,EAAE,GAAW;IACrE,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IAC1B,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,IAAI,8BAA8B,CAAC,GAAG,GAAG,mBAAmB,CAAC,CAAC;IACtE,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,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AM,CAAC;QACP,MAAM,IAAI,8BAA8B,CAAC,GAAG,IAAI,sBAAsB,CAAC,CAAC;IAC1E,CAAC;AACH,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,IAAqC;IAC5D,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IACvC,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;QAAE,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACpD,IAAI,IAAI,YAAY,WAAW;QAAE,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1D,MAAM,IAAI,8BAA8B,CAAC,oCAAoC,CAAC,CAAC;AACjF,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether a capture is persisted to Limrun's bucket after it stops.
|
|
3
|
+
* `true` persists with the server default TTL (72h); pass an object to set
|
|
4
|
+
* the TTL in seconds (capped server-side).
|
|
5
|
+
*/
|
|
6
|
+
export type PersistOption = boolean | {
|
|
7
|
+
ttlSeconds?: number;
|
|
8
|
+
};
|
|
9
|
+
/** Wire fields a persist option turns into on a start-capture message. */
|
|
10
|
+
export declare function persistFields(persist: PersistOption | undefined): {
|
|
11
|
+
persist?: boolean;
|
|
12
|
+
ttlSeconds?: number;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=persist-option.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persist-option.d.mts","sourceRoot":"","sources":["../src/internal/persist-option.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG;IAAE,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE9D,0EAA0E;AAC1E,wBAAgB,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,SAAS,GAAG;IACjE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAcA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether a capture is persisted to Limrun's bucket after it stops.
|
|
3
|
+
* `true` persists with the server default TTL (72h); pass an object to set
|
|
4
|
+
* the TTL in seconds (capped server-side).
|
|
5
|
+
*/
|
|
6
|
+
export type PersistOption = boolean | {
|
|
7
|
+
ttlSeconds?: number;
|
|
8
|
+
};
|
|
9
|
+
/** Wire fields a persist option turns into on a start-capture message. */
|
|
10
|
+
export declare function persistFields(persist: PersistOption | undefined): {
|
|
11
|
+
persist?: boolean;
|
|
12
|
+
ttlSeconds?: number;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=persist-option.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persist-option.d.ts","sourceRoot":"","sources":["../src/internal/persist-option.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG;IAAE,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE9D,0EAA0E;AAC1E,wBAAgB,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,SAAS,GAAG;IACjE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAcA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.persistFields = persistFields;
|
|
4
|
+
/** Wire fields a persist option turns into on a start-capture message. */
|
|
5
|
+
function persistFields(persist) {
|
|
6
|
+
if (!persist) {
|
|
7
|
+
return {};
|
|
8
|
+
}
|
|
9
|
+
if (persist === true) {
|
|
10
|
+
return { persist: true };
|
|
11
|
+
}
|
|
12
|
+
if (persist.ttlSeconds !== undefined &&
|
|
13
|
+
(!Number.isInteger(persist.ttlSeconds) || persist.ttlSeconds <= 0)) {
|
|
14
|
+
throw new Error('ttlSeconds must be a positive integer');
|
|
15
|
+
}
|
|
16
|
+
return { persist: true, ...(persist.ttlSeconds !== undefined && { ttlSeconds: persist.ttlSeconds }) };
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=persist-option.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persist-option.js","sourceRoot":"","sources":["../src/internal/persist-option.ts"],"names":[],"mappings":";;AAQA,sCAiBC;AAlBD,0EAA0E;AAC1E,SAAgB,aAAa,CAAC,OAAkC;IAI9D,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACrB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3B,CAAC;IACD,IACE,OAAO,CAAC,UAAU,KAAK,SAAS;QAChC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,OAAO,CAAC,UAAU,IAAI,CAAC,CAAC,EAClE,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;IAC3D,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,CAAC,OAAO,CAAC,UAAU,KAAK,SAAS,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE,CAAC,EAAE,CAAC;AACxG,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Wire fields a persist option turns into on a start-capture message. */
|
|
2
|
+
export function persistFields(persist) {
|
|
3
|
+
if (!persist) {
|
|
4
|
+
return {};
|
|
5
|
+
}
|
|
6
|
+
if (persist === true) {
|
|
7
|
+
return { persist: true };
|
|
8
|
+
}
|
|
9
|
+
if (persist.ttlSeconds !== undefined &&
|
|
10
|
+
(!Number.isInteger(persist.ttlSeconds) || persist.ttlSeconds <= 0)) {
|
|
11
|
+
throw new Error('ttlSeconds must be a positive integer');
|
|
12
|
+
}
|
|
13
|
+
return { persist: true, ...(persist.ttlSeconds !== undefined && { ttlSeconds: persist.ttlSeconds }) };
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=persist-option.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persist-option.mjs","sourceRoot":"","sources":["../src/internal/persist-option.ts"],"names":[],"mappings":"AAOA,0EAA0E;AAC1E,MAAM,UAAU,aAAa,CAAC,OAAkC;IAI9D,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACrB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3B,CAAC;IACD,IACE,OAAO,CAAC,UAAU,KAAK,SAAS;QAChC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,OAAO,CAAC,UAAU,IAAI,CAAC,CAAC,EAClE,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;IAC3D,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,CAAC,OAAO,CAAC,UAAU,KAAK,SAAS,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE,CAAC,EAAE,CAAC;AACxG,CAAC"}
|
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
import type { Agent as HttpAgent } from 'http';
|
|
2
|
+
import net from 'net';
|
|
2
3
|
import type { Fetch } from "./builtin-types.mjs";
|
|
4
|
+
export interface TcpConnectOptions {
|
|
5
|
+
/** Host actually sent to connect(2), or in the CONNECT authority. */
|
|
6
|
+
host: string;
|
|
7
|
+
port: number;
|
|
8
|
+
/**
|
|
9
|
+
* Original destination used only for HTTP_PROXY/HTTPS_PROXY/NO_PROXY
|
|
10
|
+
* selection. This may differ from host when the caller resolved a domain
|
|
11
|
+
* locally before dialing it.
|
|
12
|
+
*/
|
|
13
|
+
proxyLookupHost?: string;
|
|
14
|
+
proxyLookupProtocol: 'http:' | 'https:';
|
|
15
|
+
timeoutMs: number;
|
|
16
|
+
signal?: AbortSignal;
|
|
17
|
+
}
|
|
18
|
+
export interface TcpConnectResult {
|
|
19
|
+
socket: net.Socket;
|
|
20
|
+
connectMs: number;
|
|
21
|
+
/** Address of the destination, never the address of an HTTP proxy. */
|
|
22
|
+
remoteAddress?: string;
|
|
23
|
+
}
|
|
3
24
|
declare class NodeProxyTransport {
|
|
4
25
|
private envHttpProxyAgent;
|
|
5
26
|
private longRequestDispatcher;
|
|
@@ -14,6 +35,12 @@ declare class NodeProxyTransport {
|
|
|
14
35
|
*/
|
|
15
36
|
fetchLongRequest: Fetch;
|
|
16
37
|
getWebSocketAgent(url: string): HttpAgent | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Opens a paused TCP stream to a destination, tunneling through the proxy
|
|
40
|
+
* selected by proxy-from-env when applicable. The caller owns the returned
|
|
41
|
+
* socket and must resume it after installing data/end/error handlers.
|
|
42
|
+
*/
|
|
43
|
+
connectTcp(options: TcpConnectOptions): Promise<TcpConnectResult>;
|
|
17
44
|
private getEnvHttpProxyAgent;
|
|
18
45
|
private hasProxyEnv;
|
|
19
46
|
private getWebSocketProxyLookupUrl;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proxy-transport.d.mts","sourceRoot":"","sources":["../src/internal/proxy-transport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"proxy-transport.d.mts","sourceRoot":"","sources":["../src/internal/proxy-transport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAC/C,OAAO,GAAG,MAAM,KAAK,CAAC;AAOtB,OAAO,KAAK,EAAE,KAAK,EAAE,4BAAwB;AAS7C,MAAM,WAAW,iBAAiB;IAChC,qEAAqE;IACrE,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mBAAmB,EAAE,OAAO,GAAG,QAAQ,CAAC;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,sEAAsE;IACtE,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,cAAM,kBAAkB;IACtB,OAAO,CAAC,iBAAiB,CAAgC;IACzD,OAAO,CAAC,qBAAqB,CAAgC;IAC7D,OAAO,CAAC,eAAe,CAAgC;IAEvD,KAAK,EAAE,KAAK,CASV;IAEF;;;;;;OAMG;IACH,gBAAgB,EAAE,KAAK,CAMrB;IAEF,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS;IAoBrD;;;;OAIG;IACH,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAUjE,OAAO,CAAC,oBAAoB;IAK5B,OAAO,CAAC,WAAW;IASnB,OAAO,CAAC,0BAA0B;CASnC;AAED,eAAO,MAAM,kBAAkB,oBAA2B,CAAC"}
|
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
import type { Agent as HttpAgent } from 'http';
|
|
2
|
+
import net from 'net';
|
|
2
3
|
import type { Fetch } from "./builtin-types.js";
|
|
4
|
+
export interface TcpConnectOptions {
|
|
5
|
+
/** Host actually sent to connect(2), or in the CONNECT authority. */
|
|
6
|
+
host: string;
|
|
7
|
+
port: number;
|
|
8
|
+
/**
|
|
9
|
+
* Original destination used only for HTTP_PROXY/HTTPS_PROXY/NO_PROXY
|
|
10
|
+
* selection. This may differ from host when the caller resolved a domain
|
|
11
|
+
* locally before dialing it.
|
|
12
|
+
*/
|
|
13
|
+
proxyLookupHost?: string;
|
|
14
|
+
proxyLookupProtocol: 'http:' | 'https:';
|
|
15
|
+
timeoutMs: number;
|
|
16
|
+
signal?: AbortSignal;
|
|
17
|
+
}
|
|
18
|
+
export interface TcpConnectResult {
|
|
19
|
+
socket: net.Socket;
|
|
20
|
+
connectMs: number;
|
|
21
|
+
/** Address of the destination, never the address of an HTTP proxy. */
|
|
22
|
+
remoteAddress?: string;
|
|
23
|
+
}
|
|
3
24
|
declare class NodeProxyTransport {
|
|
4
25
|
private envHttpProxyAgent;
|
|
5
26
|
private longRequestDispatcher;
|
|
@@ -14,6 +35,12 @@ declare class NodeProxyTransport {
|
|
|
14
35
|
*/
|
|
15
36
|
fetchLongRequest: Fetch;
|
|
16
37
|
getWebSocketAgent(url: string): HttpAgent | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Opens a paused TCP stream to a destination, tunneling through the proxy
|
|
40
|
+
* selected by proxy-from-env when applicable. The caller owns the returned
|
|
41
|
+
* socket and must resume it after installing data/end/error handlers.
|
|
42
|
+
*/
|
|
43
|
+
connectTcp(options: TcpConnectOptions): Promise<TcpConnectResult>;
|
|
17
44
|
private getEnvHttpProxyAgent;
|
|
18
45
|
private hasProxyEnv;
|
|
19
46
|
private getWebSocketProxyLookupUrl;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proxy-transport.d.ts","sourceRoot":"","sources":["../src/internal/proxy-transport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"proxy-transport.d.ts","sourceRoot":"","sources":["../src/internal/proxy-transport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAC/C,OAAO,GAAG,MAAM,KAAK,CAAC;AAOtB,OAAO,KAAK,EAAE,KAAK,EAAE,2BAAwB;AAS7C,MAAM,WAAW,iBAAiB;IAChC,qEAAqE;IACrE,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mBAAmB,EAAE,OAAO,GAAG,QAAQ,CAAC;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,sEAAsE;IACtE,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,cAAM,kBAAkB;IACtB,OAAO,CAAC,iBAAiB,CAAgC;IACzD,OAAO,CAAC,qBAAqB,CAAgC;IAC7D,OAAO,CAAC,eAAe,CAAgC;IAEvD,KAAK,EAAE,KAAK,CASV;IAEF;;;;;;OAMG;IACH,gBAAgB,EAAE,KAAK,CAMrB;IAEF,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS;IAoBrD;;;;OAIG;IACH,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAUjE,OAAO,CAAC,oBAAoB;IAK5B,OAAO,CAAC,WAAW;IASnB,OAAO,CAAC,0BAA0B;CASnC;AAED,eAAO,MAAM,kBAAkB,oBAA2B,CAAC"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.nodeProxyTransport = void 0;
|
|
4
|
+
const tslib_1 = require("./tslib.js");
|
|
5
|
+
const net_1 = tslib_1.__importDefault(require("net"));
|
|
6
|
+
const tls_1 = tslib_1.__importDefault(require("tls"));
|
|
4
7
|
const https_proxy_agent_1 = require("https-proxy-agent");
|
|
5
8
|
const proxy_from_env_1 = require("proxy-from-env");
|
|
6
9
|
const undici_1 = require("undici");
|
|
@@ -9,6 +12,7 @@ const undici_1 = require("undici");
|
|
|
9
12
|
// the first to give up. undici's defaults are 300s, which would abort e.g. an
|
|
10
13
|
// instance-side artifact upload that takes longer.
|
|
11
14
|
const longRequestTimeouts = { headersTimeout: 3600000, bodyTimeout: 3600000 };
|
|
15
|
+
const maxConnectResponseHeaderBytes = 64 * 1024;
|
|
12
16
|
class NodeProxyTransport {
|
|
13
17
|
constructor() {
|
|
14
18
|
this.websocketAgents = new Map();
|
|
@@ -52,6 +56,20 @@ class NodeProxyTransport {
|
|
|
52
56
|
}
|
|
53
57
|
return agent;
|
|
54
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* Opens a paused TCP stream to a destination, tunneling through the proxy
|
|
61
|
+
* selected by proxy-from-env when applicable. The caller owns the returned
|
|
62
|
+
* socket and must resume it after installing data/end/error handlers.
|
|
63
|
+
*/
|
|
64
|
+
connectTcp(options) {
|
|
65
|
+
const lookupHost = options.proxyLookupHost ?? options.host;
|
|
66
|
+
const lookupUrl = `${options.proxyLookupProtocol}//${formatAuthority(lookupHost, options.port)}`;
|
|
67
|
+
const proxyUrl = (0, proxy_from_env_1.getProxyForUrl)(lookupUrl);
|
|
68
|
+
if (!proxyUrl) {
|
|
69
|
+
return connectDirect(options);
|
|
70
|
+
}
|
|
71
|
+
return connectThroughProxy(proxyUrl, options);
|
|
72
|
+
}
|
|
55
73
|
getEnvHttpProxyAgent() {
|
|
56
74
|
this.envHttpProxyAgent ?? (this.envHttpProxyAgent = new undici_1.EnvHttpProxyAgent());
|
|
57
75
|
return this.envHttpProxyAgent;
|
|
@@ -75,4 +93,192 @@ class NodeProxyTransport {
|
|
|
75
93
|
}
|
|
76
94
|
}
|
|
77
95
|
exports.nodeProxyTransport = new NodeProxyTransport();
|
|
96
|
+
function connectDirect(options) {
|
|
97
|
+
const startedAt = Date.now();
|
|
98
|
+
return new Promise((resolve, reject) => {
|
|
99
|
+
let settled = false;
|
|
100
|
+
const socket = net_1.default.createConnection({
|
|
101
|
+
host: options.host,
|
|
102
|
+
port: options.port,
|
|
103
|
+
allowHalfOpen: true,
|
|
104
|
+
});
|
|
105
|
+
const timer = setTimeout(() => {
|
|
106
|
+
fail(codedError(`connection to ${formatAuthority(options.host, options.port)} timed out`, 'ETIMEDOUT'));
|
|
107
|
+
}, options.timeoutMs);
|
|
108
|
+
timer.unref();
|
|
109
|
+
const cleanup = () => {
|
|
110
|
+
clearTimeout(timer);
|
|
111
|
+
socket.removeListener('connect', onConnect);
|
|
112
|
+
socket.removeListener('error', fail);
|
|
113
|
+
options.signal?.removeEventListener('abort', onAbort);
|
|
114
|
+
};
|
|
115
|
+
const fail = (error) => {
|
|
116
|
+
if (settled)
|
|
117
|
+
return;
|
|
118
|
+
settled = true;
|
|
119
|
+
cleanup();
|
|
120
|
+
socket.destroy();
|
|
121
|
+
reject(error);
|
|
122
|
+
};
|
|
123
|
+
const onAbort = () => fail(codedError('TCP connection cancelled', 'ECANCELED'));
|
|
124
|
+
const onConnect = () => {
|
|
125
|
+
if (settled)
|
|
126
|
+
return;
|
|
127
|
+
settled = true;
|
|
128
|
+
socket.pause();
|
|
129
|
+
cleanup();
|
|
130
|
+
resolve({
|
|
131
|
+
socket,
|
|
132
|
+
connectMs: Date.now() - startedAt,
|
|
133
|
+
...(socket.remoteAddress === undefined ? {} : { remoteAddress: socket.remoteAddress }),
|
|
134
|
+
});
|
|
135
|
+
};
|
|
136
|
+
socket.once('connect', onConnect);
|
|
137
|
+
socket.once('error', fail);
|
|
138
|
+
if (options.signal?.aborted) {
|
|
139
|
+
onAbort();
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
options.signal?.addEventListener('abort', onAbort, { once: true });
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
function connectThroughProxy(proxyUrlString, options) {
|
|
147
|
+
const startedAt = Date.now();
|
|
148
|
+
return new Promise((resolve, reject) => {
|
|
149
|
+
let settled = false;
|
|
150
|
+
let response = Buffer.alloc(0);
|
|
151
|
+
let proxyUrl;
|
|
152
|
+
try {
|
|
153
|
+
proxyUrl = new URL(proxyUrlString);
|
|
154
|
+
}
|
|
155
|
+
catch {
|
|
156
|
+
reject(codedError(`invalid proxy URL: ${proxyUrlString}`, 'EPROXY'));
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
if (proxyUrl.protocol !== 'http:' && proxyUrl.protocol !== 'https:') {
|
|
160
|
+
reject(codedError(`unsupported proxy protocol ${proxyUrl.protocol}`, 'EPROXY'));
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
const proxyPort = proxyUrl.port ? Number(proxyUrl.port)
|
|
164
|
+
: proxyUrl.protocol === 'https:' ? 443
|
|
165
|
+
: 80;
|
|
166
|
+
const proxyHost = unbracketHost(proxyUrl.hostname);
|
|
167
|
+
const socket = proxyUrl.protocol === 'https:' ?
|
|
168
|
+
tls_1.default.connect({
|
|
169
|
+
host: proxyHost,
|
|
170
|
+
port: proxyPort,
|
|
171
|
+
rejectUnauthorized: true,
|
|
172
|
+
...(net_1.default.isIP(proxyHost) ? {} : { servername: proxyHost }),
|
|
173
|
+
ALPNProtocols: ['http/1.1'],
|
|
174
|
+
})
|
|
175
|
+
: net_1.default.createConnection({
|
|
176
|
+
host: proxyHost,
|
|
177
|
+
port: proxyPort,
|
|
178
|
+
allowHalfOpen: true,
|
|
179
|
+
});
|
|
180
|
+
socket.allowHalfOpen = true;
|
|
181
|
+
const connectedEvent = proxyUrl.protocol === 'https:' ? 'secureConnect' : 'connect';
|
|
182
|
+
const timer = setTimeout(() => {
|
|
183
|
+
fail(codedError(`proxy connection to ${formatAuthority(options.host, options.port)} timed out`, 'ETIMEDOUT'));
|
|
184
|
+
}, options.timeoutMs);
|
|
185
|
+
timer.unref();
|
|
186
|
+
const cleanup = () => {
|
|
187
|
+
clearTimeout(timer);
|
|
188
|
+
socket.removeListener(connectedEvent, onProxyConnected);
|
|
189
|
+
socket.removeListener('data', onData);
|
|
190
|
+
socket.removeListener('end', onUnexpectedClose);
|
|
191
|
+
socket.removeListener('close', onUnexpectedClose);
|
|
192
|
+
socket.removeListener('error', fail);
|
|
193
|
+
options.signal?.removeEventListener('abort', onAbort);
|
|
194
|
+
};
|
|
195
|
+
const fail = (error) => {
|
|
196
|
+
if (settled)
|
|
197
|
+
return;
|
|
198
|
+
settled = true;
|
|
199
|
+
cleanup();
|
|
200
|
+
socket.destroy();
|
|
201
|
+
reject(error);
|
|
202
|
+
};
|
|
203
|
+
const onAbort = () => fail(codedError('proxy connection cancelled', 'ECANCELED'));
|
|
204
|
+
const onUnexpectedClose = () => fail(codedError('proxy closed before completing CONNECT', 'ECONNRESET'));
|
|
205
|
+
const onProxyConnected = () => {
|
|
206
|
+
const authority = formatAuthority(options.host, options.port);
|
|
207
|
+
const headers = [`CONNECT ${authority} HTTP/1.1`, `Host: ${authority}`, 'Proxy-Connection: Keep-Alive'];
|
|
208
|
+
if (proxyUrl.username || proxyUrl.password) {
|
|
209
|
+
const username = decodeUrlCredential(proxyUrl.username);
|
|
210
|
+
const password = decodeUrlCredential(proxyUrl.password);
|
|
211
|
+
headers.push(`Proxy-Authorization: Basic ${Buffer.from(`${username}:${password}`, 'utf8').toString('base64')}`);
|
|
212
|
+
}
|
|
213
|
+
socket.write(`${headers.join('\r\n')}\r\n\r\n`);
|
|
214
|
+
};
|
|
215
|
+
const onData = (chunk) => {
|
|
216
|
+
response = Buffer.concat([response, chunk]);
|
|
217
|
+
const headerEnd = response.indexOf('\r\n\r\n');
|
|
218
|
+
if (headerEnd < 0) {
|
|
219
|
+
if (response.length > maxConnectResponseHeaderBytes) {
|
|
220
|
+
fail(codedError('proxy CONNECT response headers exceeded 65536 bytes', 'EPROXY'));
|
|
221
|
+
}
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
if (headerEnd + 4 > maxConnectResponseHeaderBytes) {
|
|
225
|
+
fail(codedError('proxy CONNECT response headers exceeded 65536 bytes', 'EPROXY'));
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
const statusLineEnd = response.indexOf('\r\n');
|
|
229
|
+
const statusLine = response
|
|
230
|
+
.subarray(0, statusLineEnd < 0 ? headerEnd : statusLineEnd)
|
|
231
|
+
.toString('latin1');
|
|
232
|
+
const statusMatch = /^HTTP\/1\.[01] ([0-9]{3})(?: |$)/.exec(statusLine);
|
|
233
|
+
if (!statusMatch) {
|
|
234
|
+
fail(codedError(`invalid proxy CONNECT response: ${statusLine}`, 'EPROXY'));
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
const statusCode = Number(statusMatch[1]);
|
|
238
|
+
if (statusCode < 200 || statusCode >= 300) {
|
|
239
|
+
fail(codedError(`proxy CONNECT failed with status ${statusCode}`, statusCode === 407 ? 'EPROXYAUTH' : 'EPROXYCONNECT'));
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
settled = true;
|
|
243
|
+
socket.pause();
|
|
244
|
+
cleanup();
|
|
245
|
+
const remainder = response.subarray(headerEnd + 4);
|
|
246
|
+
if (remainder.length > 0)
|
|
247
|
+
socket.unshift(remainder);
|
|
248
|
+
resolve({
|
|
249
|
+
socket,
|
|
250
|
+
connectMs: Date.now() - startedAt,
|
|
251
|
+
remoteAddress: options.host,
|
|
252
|
+
});
|
|
253
|
+
};
|
|
254
|
+
socket.once(connectedEvent, onProxyConnected);
|
|
255
|
+
socket.on('data', onData);
|
|
256
|
+
socket.once('end', onUnexpectedClose);
|
|
257
|
+
socket.once('close', onUnexpectedClose);
|
|
258
|
+
socket.once('error', fail);
|
|
259
|
+
if (options.signal?.aborted) {
|
|
260
|
+
onAbort();
|
|
261
|
+
}
|
|
262
|
+
else {
|
|
263
|
+
options.signal?.addEventListener('abort', onAbort, { once: true });
|
|
264
|
+
}
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
function formatAuthority(host, port) {
|
|
268
|
+
return `${net_1.default.isIP(host) === 6 ? `[${host}]` : host}:${port}`;
|
|
269
|
+
}
|
|
270
|
+
function unbracketHost(host) {
|
|
271
|
+
return host.startsWith('[') && host.endsWith(']') ? host.slice(1, -1) : host;
|
|
272
|
+
}
|
|
273
|
+
function decodeUrlCredential(value) {
|
|
274
|
+
try {
|
|
275
|
+
return decodeURIComponent(value);
|
|
276
|
+
}
|
|
277
|
+
catch {
|
|
278
|
+
return value;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
function codedError(message, code) {
|
|
282
|
+
return Object.assign(new Error(message), { code });
|
|
283
|
+
}
|
|
78
284
|
//# sourceMappingURL=proxy-transport.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proxy-transport.js","sourceRoot":"","sources":["../src/internal/proxy-transport.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"proxy-transport.js","sourceRoot":"","sources":["../src/internal/proxy-transport.ts"],"names":[],"mappings":";;;;AACA,sDAAsB;AACtB,sDAAsB;AAEtB,yDAAoD;AACpD,mDAAgD;AAChD,mCAA2C;AAI3C,8EAA8E;AAC9E,6EAA6E;AAC7E,8EAA8E;AAC9E,mDAAmD;AACnD,MAAM,mBAAmB,GAAG,EAAE,cAAc,EAAE,OAAS,EAAE,WAAW,EAAE,OAAS,EAAE,CAAC;AAClF,MAAM,6BAA6B,GAAG,EAAE,GAAG,IAAI,CAAC;AAwBhD,MAAM,kBAAkB;IAAxB;QAGU,oBAAe,GAAG,IAAI,GAAG,EAAqB,CAAC;QAEvD,UAAK,GAAU,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;YACnC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;gBACxB,OAAO,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;YAC5B,CAAC;YAED,OAAQ,KAAa,CAAC,KAAK,EAAE;gBAC3B,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC;gBACf,UAAU,EAAE,IAAI,CAAC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