nlcurl 0.1.0 → 0.2.0
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/README.md +5 -13
- package/dist/cli/args.d.ts +37 -5
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +6 -17
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/index.d.ts +3 -3
- package/dist/cli/index.js +25 -10
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/output.d.ts +24 -7
- package/dist/cli/output.d.ts.map +1 -1
- package/dist/cli/output.js +24 -12
- package/dist/cli/output.js.map +1 -1
- package/dist/cookies/jar.d.ts +45 -13
- package/dist/cookies/jar.d.ts.map +1 -1
- package/dist/cookies/jar.js +88 -29
- package/dist/cookies/jar.js.map +1 -1
- package/dist/cookies/parser.d.ts +25 -3
- package/dist/cookies/parser.d.ts.map +1 -1
- package/dist/cookies/parser.js +12 -7
- package/dist/cookies/parser.js.map +1 -1
- package/dist/core/client.d.ts +49 -33
- package/dist/core/client.d.ts.map +1 -1
- package/dist/core/client.js +64 -38
- package/dist/core/client.js.map +1 -1
- package/dist/core/errors.d.ts +94 -6
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core/errors.js +95 -6
- package/dist/core/errors.js.map +1 -1
- package/dist/core/request.d.ts +96 -30
- package/dist/core/request.d.ts.map +1 -1
- package/dist/core/request.js +0 -3
- package/dist/core/request.js.map +1 -1
- package/dist/core/response.d.ts +92 -8
- package/dist/core/response.d.ts.map +1 -1
- package/dist/core/response.js +92 -7
- package/dist/core/response.js.map +1 -1
- package/dist/core/session.d.ts +109 -14
- package/dist/core/session.d.ts.map +1 -1
- package/dist/core/session.js +124 -46
- package/dist/core/session.js.map +1 -1
- package/dist/fingerprints/akamai.d.ts +11 -11
- package/dist/fingerprints/akamai.d.ts.map +1 -1
- package/dist/fingerprints/akamai.js +10 -14
- package/dist/fingerprints/akamai.js.map +1 -1
- package/dist/fingerprints/database.d.ts +14 -15
- package/dist/fingerprints/database.d.ts.map +1 -1
- package/dist/fingerprints/database.js +14 -19
- package/dist/fingerprints/database.js.map +1 -1
- package/dist/fingerprints/extensions.d.ts +121 -27
- package/dist/fingerprints/extensions.d.ts.map +1 -1
- package/dist/fingerprints/extensions.js +132 -49
- package/dist/fingerprints/extensions.js.map +1 -1
- package/dist/fingerprints/ja3.d.ts +34 -18
- package/dist/fingerprints/ja3.d.ts.map +1 -1
- package/dist/fingerprints/ja3.js +34 -18
- package/dist/fingerprints/ja3.js.map +1 -1
- package/dist/fingerprints/profiles/chrome.d.ts +21 -10
- package/dist/fingerprints/profiles/chrome.d.ts.map +1 -1
- package/dist/fingerprints/profiles/chrome.js +25 -22
- package/dist/fingerprints/profiles/chrome.js.map +1 -1
- package/dist/fingerprints/profiles/edge.d.ts +10 -7
- package/dist/fingerprints/profiles/edge.d.ts.map +1 -1
- package/dist/fingerprints/profiles/edge.js +10 -10
- package/dist/fingerprints/profiles/edge.js.map +1 -1
- package/dist/fingerprints/profiles/firefox.d.ts +11 -3
- package/dist/fingerprints/profiles/firefox.d.ts.map +1 -1
- package/dist/fingerprints/profiles/firefox.js +15 -14
- package/dist/fingerprints/profiles/firefox.js.map +1 -1
- package/dist/fingerprints/profiles/safari.d.ts +14 -3
- package/dist/fingerprints/profiles/safari.d.ts.map +1 -1
- package/dist/fingerprints/profiles/safari.js +16 -13
- package/dist/fingerprints/profiles/safari.js.map +1 -1
- package/dist/fingerprints/profiles/tor.d.ts +8 -7
- package/dist/fingerprints/profiles/tor.d.ts.map +1 -1
- package/dist/fingerprints/profiles/tor.js +8 -14
- package/dist/fingerprints/profiles/tor.js.map +1 -1
- package/dist/fingerprints/types.d.ts +70 -47
- package/dist/fingerprints/types.d.ts.map +1 -1
- package/dist/fingerprints/types.js +0 -7
- package/dist/fingerprints/types.js.map +1 -1
- package/dist/http/h1/client.d.ts +30 -9
- package/dist/http/h1/client.d.ts.map +1 -1
- package/dist/http/h1/client.js +152 -15
- package/dist/http/h1/client.js.map +1 -1
- package/dist/http/h1/encoder.d.ts +9 -6
- package/dist/http/h1/encoder.d.ts.map +1 -1
- package/dist/http/h1/encoder.js +8 -12
- package/dist/http/h1/encoder.js.map +1 -1
- package/dist/http/h1/parser.d.ts +68 -14
- package/dist/http/h1/parser.d.ts.map +1 -1
- package/dist/http/h1/parser.js +92 -37
- package/dist/http/h1/parser.js.map +1 -1
- package/dist/http/h2/client.d.ts +81 -14
- package/dist/http/h2/client.d.ts.map +1 -1
- package/dist/http/h2/client.js +465 -63
- package/dist/http/h2/client.js.map +1 -1
- package/dist/http/h2/frames.d.ts +103 -6
- package/dist/http/h2/frames.d.ts.map +1 -1
- package/dist/http/h2/frames.js +96 -17
- package/dist/http/h2/frames.js.map +1 -1
- package/dist/http/h2/hpack.d.ts +30 -5
- package/dist/http/h2/hpack.d.ts.map +1 -1
- package/dist/http/h2/hpack.js +39 -35
- package/dist/http/h2/hpack.js.map +1 -1
- package/dist/http/negotiator.d.ts +35 -12
- package/dist/http/negotiator.d.ts.map +1 -1
- package/dist/http/negotiator.js +89 -24
- package/dist/http/negotiator.js.map +1 -1
- package/dist/http/pool.d.ts +66 -17
- package/dist/http/pool.d.ts.map +1 -1
- package/dist/http/pool.js +47 -20
- package/dist/http/pool.js.map +1 -1
- package/dist/index.d.ts +2 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -13
- package/dist/index.js.map +1 -1
- package/dist/middleware/interceptor.d.ts +40 -8
- package/dist/middleware/interceptor.d.ts.map +1 -1
- package/dist/middleware/interceptor.js +28 -6
- package/dist/middleware/interceptor.js.map +1 -1
- package/dist/middleware/rate-limiter.d.ts +18 -5
- package/dist/middleware/rate-limiter.d.ts.map +1 -1
- package/dist/middleware/rate-limiter.js +12 -7
- package/dist/middleware/rate-limiter.js.map +1 -1
- package/dist/middleware/retry.d.ts +17 -5
- package/dist/middleware/retry.d.ts.map +1 -1
- package/dist/middleware/retry.js +13 -11
- package/dist/middleware/retry.js.map +1 -1
- package/dist/proxy/http-proxy.d.ts +17 -9
- package/dist/proxy/http-proxy.d.ts.map +1 -1
- package/dist/proxy/http-proxy.js +9 -13
- package/dist/proxy/http-proxy.js.map +1 -1
- package/dist/proxy/socks.d.ts +20 -9
- package/dist/proxy/socks.d.ts.map +1 -1
- package/dist/proxy/socks.js +20 -31
- package/dist/proxy/socks.js.map +1 -1
- package/dist/tls/constants.d.ts +74 -4
- package/dist/tls/constants.d.ts.map +1 -1
- package/dist/tls/constants.js +75 -21
- package/dist/tls/constants.js.map +1 -1
- package/dist/tls/node-engine.d.ts +17 -16
- package/dist/tls/node-engine.d.ts.map +1 -1
- package/dist/tls/node-engine.js +20 -27
- package/dist/tls/node-engine.js.map +1 -1
- package/dist/tls/stealth/client-hello.d.ts +32 -16
- package/dist/tls/stealth/client-hello.d.ts.map +1 -1
- package/dist/tls/stealth/client-hello.js +13 -37
- package/dist/tls/stealth/client-hello.js.map +1 -1
- package/dist/tls/stealth/engine.d.ts +18 -10
- package/dist/tls/stealth/engine.d.ts.map +1 -1
- package/dist/tls/stealth/engine.js +18 -24
- package/dist/tls/stealth/engine.js.map +1 -1
- package/dist/tls/stealth/handshake.d.ts +31 -17
- package/dist/tls/stealth/handshake.d.ts.map +1 -1
- package/dist/tls/stealth/handshake.js +173 -74
- package/dist/tls/stealth/handshake.js.map +1 -1
- package/dist/tls/stealth/key-schedule.d.ts +89 -32
- package/dist/tls/stealth/key-schedule.d.ts.map +1 -1
- package/dist/tls/stealth/key-schedule.js +62 -42
- package/dist/tls/stealth/key-schedule.js.map +1 -1
- package/dist/tls/stealth/record-layer.d.ts +76 -25
- package/dist/tls/stealth/record-layer.d.ts.map +1 -1
- package/dist/tls/stealth/record-layer.js +66 -36
- package/dist/tls/stealth/record-layer.js.map +1 -1
- package/dist/tls/types.d.ts +33 -25
- package/dist/tls/types.d.ts.map +1 -1
- package/dist/tls/types.js +0 -4
- package/dist/tls/types.js.map +1 -1
- package/dist/utils/buffer-reader.d.ts +99 -7
- package/dist/utils/buffer-reader.d.ts.map +1 -1
- package/dist/utils/buffer-reader.js +99 -7
- package/dist/utils/buffer-reader.js.map +1 -1
- package/dist/utils/buffer-writer.d.ts +99 -10
- package/dist/utils/buffer-writer.d.ts.map +1 -1
- package/dist/utils/buffer-writer.js +101 -12
- package/dist/utils/buffer-writer.js.map +1 -1
- package/dist/utils/encoding.d.ts +33 -8
- package/dist/utils/encoding.d.ts.map +1 -1
- package/dist/utils/encoding.js +58 -13
- package/dist/utils/encoding.js.map +1 -1
- package/dist/utils/logger.d.ts +61 -2
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js +52 -4
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/url.d.ts +47 -7
- package/dist/utils/url.d.ts.map +1 -1
- package/dist/utils/url.js +47 -7
- package/dist/utils/url.js.map +1 -1
- package/dist/ws/client.d.ts +59 -15
- package/dist/ws/client.d.ts.map +1 -1
- package/dist/ws/client.js +34 -27
- package/dist/ws/client.js.map +1 -1
- package/dist/ws/frame.d.ts +43 -9
- package/dist/ws/frame.d.ts.map +1 -1
- package/dist/ws/frame.js +35 -19
- package/dist/ws/frame.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tor Browser fingerprint profiles.
|
|
3
|
-
*
|
|
4
|
-
* Tor Browser is based on Firefox ESR with specific privacy hardening.
|
|
5
|
-
* It uses a narrower set of cipher suites and extensions to reduce
|
|
6
|
-
* fingerprint uniqueness across Tor users.
|
|
7
|
-
*/
|
|
8
1
|
import type { BrowserProfile } from '../types.js';
|
|
2
|
+
/** {@link BrowserProfile} impersonating Tor Browser 13.3 (based on Firefox 128). */
|
|
9
3
|
export declare const tor133: BrowserProfile;
|
|
4
|
+
/** {@link BrowserProfile} impersonating Tor Browser 14.0 (based on Firefox 128). */
|
|
10
5
|
export declare const tor140: BrowserProfile;
|
|
6
|
+
/** {@link BrowserProfile} impersonating Tor Browser 14.5 (based on Firefox 128). */
|
|
11
7
|
export declare const tor145: BrowserProfile;
|
|
8
|
+
/** Alias for the most recent Tor Browser profile ({@link tor145}). */
|
|
12
9
|
export declare const torLatest: BrowserProfile;
|
|
10
|
+
/**
|
|
11
|
+
* Registry of all available Tor Browser {@link BrowserProfile} instances keyed
|
|
12
|
+
* by profile name (e.g. `"tor145"`) and the alias `"tor_latest"`.
|
|
13
|
+
*/
|
|
13
14
|
export declare const torProfiles: ReadonlyMap<string, BrowserProfile>;
|
|
14
15
|
//# sourceMappingURL=tor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tor.d.ts","sourceRoot":"","sources":["../../../src/fingerprints/profiles/tor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tor.d.ts","sourceRoot":"","sources":["../../../src/fingerprints/profiles/tor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,cAAc,EAKf,MAAM,aAAa,CAAC;AAiIrB,oFAAoF;AACpF,eAAO,MAAM,MAAM,gBAAgC,CAAC;AACpD,oFAAoF;AACpF,eAAO,MAAM,MAAM,gBAAgC,CAAC;AACpD,oFAAoF;AACpF,eAAO,MAAM,MAAM,gBAAgC,CAAC;AAEpD,sEAAsE;AACtE,eAAO,MAAM,SAAS,gBAAS,CAAC;AAEhC;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,MAAM,EAAE,cAAc,CAK1D,CAAC"}
|
|
@@ -1,13 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tor Browser fingerprint profiles.
|
|
3
|
-
*
|
|
4
|
-
* Tor Browser is based on Firefox ESR with specific privacy hardening.
|
|
5
|
-
* It uses a narrower set of cipher suites and extensions to reduce
|
|
6
|
-
* fingerprint uniqueness across Tor users.
|
|
7
|
-
*/
|
|
8
1
|
import { CipherSuite, ExtensionType, NamedGroup, SignatureScheme, ECPointFormat, PskKeyExchangeMode, ProtocolVersion, } from '../../tls/constants.js';
|
|
9
2
|
import * as ext from '../extensions.js';
|
|
10
|
-
// ---- Tor cipher suites (same as Firefox but no_padding removed) ----
|
|
11
3
|
const TOR_CIPHER_SUITES = [
|
|
12
4
|
CipherSuite.TLS_AES_128_GCM_SHA256,
|
|
13
5
|
CipherSuite.TLS_CHACHA20_POLY1305_SHA256,
|
|
@@ -44,7 +36,6 @@ const TOR_SIGALGS = [
|
|
|
44
36
|
SignatureScheme.RSA_PKCS1_SHA384,
|
|
45
37
|
SignatureScheme.RSA_PKCS1_SHA512,
|
|
46
38
|
];
|
|
47
|
-
// ---- Extensions ----
|
|
48
39
|
function torExtensions() {
|
|
49
40
|
return [
|
|
50
41
|
{ type: ExtensionType.SERVER_NAME, data: ext.sniData },
|
|
@@ -62,7 +53,6 @@ function torExtensions() {
|
|
|
62
53
|
{ type: ExtensionType.RECORD_SIZE_LIMIT, data: () => ext.recordSizeLimitData(16385) },
|
|
63
54
|
];
|
|
64
55
|
}
|
|
65
|
-
// ---- HTTP/2 ----
|
|
66
56
|
const TOR_H2 = {
|
|
67
57
|
settings: [
|
|
68
58
|
{ id: 1, value: 65536 },
|
|
@@ -74,7 +64,6 @@ const TOR_H2 = {
|
|
|
74
64
|
pseudoHeaderOrder: [':method', ':path', ':authority', ':scheme'],
|
|
75
65
|
priorityFrames: [],
|
|
76
66
|
};
|
|
77
|
-
// ---- Headers ----
|
|
78
67
|
function torHeaders(ffVersion) {
|
|
79
68
|
const ua = `Mozilla/5.0 (Windows NT 10.0; rv:${ffVersion}) Gecko/20100101 Firefox/${ffVersion}`;
|
|
80
69
|
return {
|
|
@@ -91,7 +80,6 @@ function torHeaders(ffVersion) {
|
|
|
91
80
|
],
|
|
92
81
|
};
|
|
93
82
|
}
|
|
94
|
-
// ---- TLS template ----
|
|
95
83
|
function torTLS() {
|
|
96
84
|
return {
|
|
97
85
|
recordVersion: ProtocolVersion.TLS_1_0,
|
|
@@ -111,7 +99,6 @@ function torTLS() {
|
|
|
111
99
|
recordSizeLimit: 16385,
|
|
112
100
|
};
|
|
113
101
|
}
|
|
114
|
-
// ---- Profile factory ----
|
|
115
102
|
function torProfile(name, ffVersion) {
|
|
116
103
|
return {
|
|
117
104
|
name,
|
|
@@ -122,11 +109,18 @@ function torProfile(name, ffVersion) {
|
|
|
122
109
|
headers: torHeaders(ffVersion),
|
|
123
110
|
};
|
|
124
111
|
}
|
|
125
|
-
|
|
112
|
+
/** {@link BrowserProfile} impersonating Tor Browser 13.3 (based on Firefox 128). */
|
|
126
113
|
export const tor133 = torProfile('tor133', '128.0');
|
|
114
|
+
/** {@link BrowserProfile} impersonating Tor Browser 14.0 (based on Firefox 128). */
|
|
127
115
|
export const tor140 = torProfile('tor140', '128.0');
|
|
116
|
+
/** {@link BrowserProfile} impersonating Tor Browser 14.5 (based on Firefox 128). */
|
|
128
117
|
export const tor145 = torProfile('tor145', '128.0');
|
|
118
|
+
/** Alias for the most recent Tor Browser profile ({@link tor145}). */
|
|
129
119
|
export const torLatest = tor145;
|
|
120
|
+
/**
|
|
121
|
+
* Registry of all available Tor Browser {@link BrowserProfile} instances keyed
|
|
122
|
+
* by profile name (e.g. `"tor145"`) and the alias `"tor_latest"`.
|
|
123
|
+
*/
|
|
130
124
|
export const torProfiles = new Map([
|
|
131
125
|
['tor133', tor133],
|
|
132
126
|
['tor140', tor140],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tor.js","sourceRoot":"","sources":["../../../src/fingerprints/profiles/tor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tor.js","sourceRoot":"","sources":["../../../src/fingerprints/profiles/tor.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,WAAW,EACX,aAAa,EACb,UAAU,EACV,eAAe,EACf,aAAa,EACb,kBAAkB,EAClB,eAAe,GAChB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,GAAG,MAAM,kBAAkB,CAAC;AAExC,MAAM,iBAAiB,GAAa;IAClC,WAAW,CAAC,sBAAsB;IAClC,WAAW,CAAC,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AAC;CACvB,CAAC,CAAC"}
|
|
@@ -1,101 +1,124 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Defines a single TLS extension that will be included in the ClientHello
|
|
3
|
+
* message. The optional `data` factory is called at handshake time to produce
|
|
4
|
+
* the extension payload bytes.
|
|
3
5
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* that the
|
|
6
|
+
* @typedef {Object} TLSExtensionDef
|
|
7
|
+
* @property {number} type - IANA extension type code.
|
|
8
|
+
* @property {Function} [data] - Factory that receives the SNI hostname and returns the extension payload.
|
|
7
9
|
*/
|
|
8
10
|
export interface TLSExtensionDef {
|
|
9
|
-
/** IANA extension type (e.g. 0x0000 for SNI). */
|
|
10
11
|
type: number;
|
|
11
|
-
/**
|
|
12
|
-
* Opaque payload builder. Receives the SNI hostname at runtime and
|
|
13
|
-
* must return the extension_data bytes (without the type/length
|
|
14
|
-
* header -- that is added automatically).
|
|
15
|
-
*
|
|
16
|
-
* If undefined the extension carries an empty payload.
|
|
17
|
-
*/
|
|
18
12
|
data?: (sni: string) => Buffer;
|
|
19
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* Full TLS fingerprint configuration used to construct a ClientHello message
|
|
16
|
+
* that mirrors a specific browser's TLS behaviour.
|
|
17
|
+
*
|
|
18
|
+
* @typedef {Object} TLSProfile
|
|
19
|
+
* @property {number} recordVersion - TLS record layer version sent in the ClientHello record header.
|
|
20
|
+
* @property {number} clientVersion - Legacy version field inside the ClientHello body.
|
|
21
|
+
* @property {number[]} cipherSuites - Ordered list of IANA cipher suite codes to advertise.
|
|
22
|
+
* @property {number[]} compressionMethods - Compression method codes (typically `[0]` for none).
|
|
23
|
+
* @property {TLSExtensionDef[]} extensions - Ordered list of extensions to include in the ClientHello.
|
|
24
|
+
* @property {number[]} supportedGroups - Named groups (key exchange curves) to advertise.
|
|
25
|
+
* @property {number[]} signatureAlgorithms - Signature scheme codes to advertise.
|
|
26
|
+
* @property {string[]} alpnProtocols - ALPN protocol names in preference order.
|
|
27
|
+
* @property {boolean} grease - Whether to inject GREASE values (RFC 8701).
|
|
28
|
+
* @property {boolean} randomSessionId - Whether to include a random legacy session ID.
|
|
29
|
+
* @property {number[]} [certCompressAlgorithms] - Certificate compression algorithm codes.
|
|
30
|
+
* @property {number[]} keyShareGroups - Groups for which to generate key share entries.
|
|
31
|
+
* @property {number[]} [pskKeyExchangeModes] - PSK key exchange mode codes.
|
|
32
|
+
* @property {number[]} supportedVersions - TLS versions to advertise in the supported_versions extension.
|
|
33
|
+
* @property {number[]} [ecPointFormats] - EC point format codes.
|
|
34
|
+
* @property {Buffer} [tokenBindingParams] - Token binding extension payload.
|
|
35
|
+
* @property {number[]} [delegatedCredentials] - Signature algorithms for delegated credentials.
|
|
36
|
+
* @property {number} [recordSizeLimit] - Maximum record size limit value.
|
|
37
|
+
* @property {string[]} [applicationSettings] - ALPS protocol names (Chrome-specific).
|
|
38
|
+
*/
|
|
20
39
|
export interface TLSProfile {
|
|
21
|
-
/** TLS record-layer version sent in the ClientHello record header.
|
|
22
|
-
* Almost always 0x0301 (TLS 1.0) for compatibility. */
|
|
23
40
|
recordVersion: number;
|
|
24
|
-
/** Client version field inside the ClientHello body.
|
|
25
|
-
* 0x0303 (TLS 1.2) for modern browsers -- real negotiation happens
|
|
26
|
-
* via the supported_versions extension. */
|
|
27
41
|
clientVersion: number;
|
|
28
|
-
/** Ordered list of cipher suite IDs (including any GREASE values). */
|
|
29
42
|
cipherSuites: number[];
|
|
30
|
-
/** Compression methods (always [0] for modern browsers). */
|
|
31
43
|
compressionMethods: number[];
|
|
32
|
-
/** Extensions in exact order. The ordering determines the JA3 hash. */
|
|
33
44
|
extensions: TLSExtensionDef[];
|
|
34
|
-
/** Named groups (supported_groups extension value). */
|
|
35
45
|
supportedGroups: number[];
|
|
36
|
-
/** Signature algorithms (signature_algorithms extension value). */
|
|
37
46
|
signatureAlgorithms: number[];
|
|
38
|
-
/** ALPN protocol list. */
|
|
39
47
|
alpnProtocols: string[];
|
|
40
|
-
/** Whether to include GREASE values for cipher suites, extensions,
|
|
41
|
-
* supported groups, and key share. */
|
|
42
48
|
grease: boolean;
|
|
43
|
-
/** If true, generate a random session ID (32 bytes). Chrome does this. */
|
|
44
49
|
randomSessionId: boolean;
|
|
45
|
-
/** Compress-certificate algorithm IDs (if the extension is present). */
|
|
46
50
|
certCompressAlgorithms?: number[];
|
|
47
|
-
/** Key-share groups to send in the ClientHello (must be a subset of
|
|
48
|
-
* supportedGroups). */
|
|
49
51
|
keyShareGroups: number[];
|
|
50
|
-
/** PSK key exchange modes. */
|
|
51
52
|
pskKeyExchangeModes?: number[];
|
|
52
|
-
/** Supported TLS versions (for the supported_versions extension). */
|
|
53
53
|
supportedVersions: number[];
|
|
54
|
-
/** EC point formats. */
|
|
55
54
|
ecPointFormats?: number[];
|
|
56
|
-
/** Token binding parameters (if the extension is present). */
|
|
57
55
|
tokenBindingParams?: Buffer;
|
|
58
|
-
/** Delegated credentials signature algorithms. */
|
|
59
56
|
delegatedCredentials?: number[];
|
|
60
|
-
/** Record size limit value. */
|
|
61
57
|
recordSizeLimit?: number;
|
|
62
|
-
/** Application settings protocols (ALPS). */
|
|
63
58
|
applicationSettings?: string[];
|
|
64
59
|
}
|
|
60
|
+
/**
|
|
61
|
+
* A single HTTP/2 SETTINGS parameter and its value.
|
|
62
|
+
*
|
|
63
|
+
* @typedef {Object} H2Setting
|
|
64
|
+
* @property {number} id - SETTINGS parameter identifier (RFC 9113).
|
|
65
|
+
* @property {number} value - Parameter value.
|
|
66
|
+
*/
|
|
65
67
|
export interface H2Setting {
|
|
66
68
|
id: number;
|
|
67
69
|
value: number;
|
|
68
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* HTTP/2 connection fingerprint that controls the SETTINGS frame, initial
|
|
73
|
+
* WINDOW_UPDATE values, pseudo-header ordering, and optional PRIORITY frames
|
|
74
|
+
* sent at connection open, matching those emitted by a specific browser.
|
|
75
|
+
*
|
|
76
|
+
* @typedef {Object} H2Profile
|
|
77
|
+
* @property {H2Setting[]} settings - SETTINGS parameters sent immediately after the preface.
|
|
78
|
+
* @property {number} windowUpdate - Connection-level initial window increment sent after SETTINGS.
|
|
79
|
+
* @property {string[]} pseudoHeaderOrder - Ordered list of HTTP/2 pseudo-header names (e.g. `[':method', ':path', ...]`).
|
|
80
|
+
* @property {Array<{streamId:number,exclusive:boolean,dependsOn:number,weight:number}>} [priorityFrames] - Optional PRIORITY frames sent after the preface.
|
|
81
|
+
* @property {string[]} [headerOrder] - Preferred ordering for regular (non-pseudo) request headers.
|
|
82
|
+
*/
|
|
69
83
|
export interface H2Profile {
|
|
70
|
-
/** SETTINGS frame entries in exact order. */
|
|
71
84
|
settings: H2Setting[];
|
|
72
|
-
/** WINDOW_UPDATE increment sent immediately after the SETTINGS. */
|
|
73
85
|
windowUpdate: number;
|
|
74
|
-
/** Pseudo-header order for requests (e.g. [":method", ":authority",
|
|
75
|
-
* ":scheme", ":path"]). */
|
|
76
86
|
pseudoHeaderOrder: string[];
|
|
77
|
-
/** Priority frames sent in the connection preface (optional). */
|
|
78
87
|
priorityFrames?: Array<{
|
|
79
88
|
streamId: number;
|
|
80
89
|
exclusive: boolean;
|
|
81
90
|
dependsOn: number;
|
|
82
91
|
weight: number;
|
|
83
92
|
}>;
|
|
84
|
-
/** Header order hint -- browsers send certain headers in a fixed order. */
|
|
85
93
|
headerOrder?: string[];
|
|
86
94
|
}
|
|
95
|
+
/**
|
|
96
|
+
* HTTP header fingerprint containing the ordered headers and `User-Agent`
|
|
97
|
+
* string that a browser sends with every request.
|
|
98
|
+
*
|
|
99
|
+
* @typedef {Object} HeaderProfile
|
|
100
|
+
* @property {Array<[string,string]>} headers - Ordered name-value header pairs.
|
|
101
|
+
* @property {string} userAgent - The browser `User-Agent` string.
|
|
102
|
+
*/
|
|
87
103
|
export interface HeaderProfile {
|
|
88
|
-
/** Default HTTP headers in the order the browser sends them. */
|
|
89
104
|
headers: Array<[string, string]>;
|
|
90
|
-
/** User-Agent string. */
|
|
91
105
|
userAgent: string;
|
|
92
106
|
}
|
|
107
|
+
/**
|
|
108
|
+
* Combined browser impersonation fingerprint that bundles TLS, HTTP/2, and
|
|
109
|
+
* HTTP header profiles under a single named browser identity.
|
|
110
|
+
*
|
|
111
|
+
* @typedef {Object} BrowserProfile
|
|
112
|
+
* @property {string} name - Human-readable profile identifier (e.g. `"chrome136"`).
|
|
113
|
+
* @property {'chrome'|'firefox'|'safari'|'edge'|'tor'} browser - Browser family.
|
|
114
|
+
* @property {string} version - Browser version string (e.g. `"136"`).
|
|
115
|
+
* @property {TLSProfile} tls - TLS ClientHello fingerprint configuration.
|
|
116
|
+
* @property {H2Profile} h2 - HTTP/2 connection fingerprint configuration.
|
|
117
|
+
* @property {HeaderProfile} headers - Default HTTP headers and `User-Agent` string.
|
|
118
|
+
*/
|
|
93
119
|
export interface BrowserProfile {
|
|
94
|
-
/** Canonical name, e.g. "chrome136". */
|
|
95
120
|
name: string;
|
|
96
|
-
/** Browser family. */
|
|
97
121
|
browser: 'chrome' | 'firefox' | 'safari' | 'edge' | 'tor';
|
|
98
|
-
/** Browser version string. */
|
|
99
122
|
version: string;
|
|
100
123
|
tls: TLSProfile;
|
|
101
124
|
h2: H2Profile;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/fingerprints/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/fingerprints/types.ts"],"names":[],"mappings":"AACA;;;;;;;;GAQG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;CAChC;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,WAAW,UAAU;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;I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E,MAAM,CAAC,CAAC,CAAC;IACjC,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,CAAC;IAC1D,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,UAAU,CAAC;IAChB,EAAE,EAAE,SAAS,CAAC;IACd,OAAO,EAAE,aAAa,CAAC;CACxB"}
|
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Fingerprint profile types.
|
|
3
|
-
*
|
|
4
|
-
* Each BrowserProfile captures every parameter needed to replicate a
|
|
5
|
-
* specific browser's TLS ClientHello and HTTP/2 connection preface so
|
|
6
|
-
* that the JA3 and Akamai h2 fingerprints match the real browser.
|
|
7
|
-
*/
|
|
8
1
|
export {};
|
|
9
2
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/fingerprints/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/fingerprints/types.ts"],"names":[],"mappings":""}
|
package/dist/http/h1/client.d.ts
CHANGED
|
@@ -1,21 +1,42 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* HTTP/1.1 client.
|
|
3
|
-
*
|
|
4
|
-
* Sends requests and receives responses over a TLS (or plain TCP)
|
|
5
|
-
* Duplex stream. Supports connection reuse (keep-alive).
|
|
6
|
-
*/
|
|
7
1
|
import type { Duplex } from 'node:stream';
|
|
8
2
|
import type { NLcURLRequest } from '../../core/request.js';
|
|
9
3
|
import { NLcURLResponse } from '../../core/response.js';
|
|
10
4
|
import type { RequestTimings } from '../../core/request.js';
|
|
5
|
+
/**
|
|
6
|
+
* Options shared across all HTTP/1.1 client functions.
|
|
7
|
+
*
|
|
8
|
+
* @typedef {Object} H1ClientOptions
|
|
9
|
+
* @property {Array<[string,string]>} [defaultHeaders] - Profile-level headers prepended before request-specific headers.
|
|
10
|
+
*/
|
|
11
11
|
export interface H1ClientOptions {
|
|
12
|
-
/** Default headers to merge with each request. */
|
|
13
12
|
defaultHeaders?: Array<[string, string]>;
|
|
14
13
|
}
|
|
15
14
|
/**
|
|
16
|
-
*
|
|
15
|
+
* Sends an HTTP/1.1 request over the given duplex stream and returns the
|
|
16
|
+
* fully buffered response. Blocks until all response body bytes are received.
|
|
17
17
|
*
|
|
18
|
-
*
|
|
18
|
+
* @param {Duplex} stream - Connected transport stream.
|
|
19
|
+
* @param {NLcURLRequest} request - Request descriptor.
|
|
20
|
+
* @param {H1ClientOptions} [options={}] - Client options.
|
|
21
|
+
* @param {Partial<RequestTimings>} [timings={}] - Partial timings object to populate with `firstByte`.
|
|
22
|
+
* @returns {Promise<NLcURLResponse>} Resolves with the fully received and decompressed response.
|
|
23
|
+
* @throws {HTTPError} If the connection is closed before the response completes.
|
|
24
|
+
* @throws {TimeoutError} If the response timeout is exceeded.
|
|
19
25
|
*/
|
|
20
26
|
export declare function sendH1Request(stream: Duplex, request: NLcURLRequest, options?: H1ClientOptions, timings?: Partial<RequestTimings>): Promise<NLcURLResponse>;
|
|
27
|
+
/**
|
|
28
|
+
* Sends an HTTP/1.1 request over the given duplex stream and returns a
|
|
29
|
+
* streaming response whose body is available as a `Readable` stream on
|
|
30
|
+
* `response.body`. The headers are fully parsed before resolving;
|
|
31
|
+
* the body is streamed asynchronously.
|
|
32
|
+
*
|
|
33
|
+
* @param {Duplex} stream - Connected transport stream.
|
|
34
|
+
* @param {NLcURLRequest} request - Request descriptor.
|
|
35
|
+
* @param {H1ClientOptions} [options={}] - Client options.
|
|
36
|
+
* @param {Partial<RequestTimings>} [timings={}] - Partial timings object to populate with `firstByte`.
|
|
37
|
+
* @returns {Promise<NLcURLResponse>} Resolves once headers are received; body is streamed via `response.body`.
|
|
38
|
+
* @throws {HTTPError} If the connection is closed before headers are received.
|
|
39
|
+
* @throws {TimeoutError} If the response timeout is exceeded.
|
|
40
|
+
*/
|
|
41
|
+
export declare function sendH1StreamingRequest(stream: Duplex, request: NLcURLRequest, options?: H1ClientOptions, timings?: Partial<RequestTimings>): Promise<NLcURLResponse>;
|
|
21
42
|
//# sourceMappingURL=client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/http/h1/client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/http/h1/client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAKxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B,cAAc,CAAC,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CAC1C;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CACjC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,aAAa,EACtB,OAAO,GAAE,eAAoB,EAC7B,OAAO,GAAE,OAAO,CAAC,cAAc,CAAM,GACpC,OAAO,CAAC,cAAc,CAAC,CAqDzB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,aAAa,EACtB,OAAO,GAAE,eAAoB,EAC7B,OAAO,GAAE,OAAO,CAAC,cAAc,CAAM,GACpC,OAAO,CAAC,cAAc,CAAC,CAwDzB"}
|
package/dist/http/h1/client.js
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
* HTTP/1.1 client.
|
|
3
|
-
*
|
|
4
|
-
* Sends requests and receives responses over a TLS (or plain TCP)
|
|
5
|
-
* Duplex stream. Supports connection reuse (keep-alive).
|
|
6
|
-
*/
|
|
1
|
+
import { PassThrough } from 'node:stream';
|
|
7
2
|
import { NLcURLResponse } from '../../core/response.js';
|
|
8
3
|
import { HTTPError, TimeoutError } from '../../core/errors.js';
|
|
9
4
|
import { encodeRequest } from './encoder.js';
|
|
10
5
|
import { HttpResponseParser } from './parser.js';
|
|
11
|
-
import { decompressBody } from '../../utils/encoding.js';
|
|
6
|
+
import { decompressBody, createDecompressStream } from '../../utils/encoding.js';
|
|
12
7
|
/**
|
|
13
|
-
*
|
|
8
|
+
* Sends an HTTP/1.1 request over the given duplex stream and returns the
|
|
9
|
+
* fully buffered response. Blocks until all response body bytes are received.
|
|
14
10
|
*
|
|
15
|
-
*
|
|
11
|
+
* @param {Duplex} stream - Connected transport stream.
|
|
12
|
+
* @param {NLcURLRequest} request - Request descriptor.
|
|
13
|
+
* @param {H1ClientOptions} [options={}] - Client options.
|
|
14
|
+
* @param {Partial<RequestTimings>} [timings={}] - Partial timings object to populate with `firstByte`.
|
|
15
|
+
* @returns {Promise<NLcURLResponse>} Resolves with the fully received and decompressed response.
|
|
16
|
+
* @throws {HTTPError} If the connection is closed before the response completes.
|
|
17
|
+
* @throws {TimeoutError} If the response timeout is exceeded.
|
|
16
18
|
*/
|
|
17
19
|
export async function sendH1Request(stream, request, options = {}, timings = {}) {
|
|
18
20
|
const encoded = encodeRequest(request, options.defaultHeaders ?? []);
|
|
19
|
-
// Write request
|
|
20
21
|
await new Promise((resolve, reject) => {
|
|
21
22
|
stream.write(encoded, (err) => {
|
|
22
23
|
if (err)
|
|
@@ -25,14 +26,12 @@ export async function sendH1Request(stream, request, options = {}, timings = {})
|
|
|
25
26
|
resolve();
|
|
26
27
|
});
|
|
27
28
|
});
|
|
28
|
-
// Read response
|
|
29
29
|
const parser = new HttpResponseParser(request.method ?? 'GET');
|
|
30
30
|
const parsed = await readResponse(stream, parser, request);
|
|
31
31
|
const firstByteTime = Date.now();
|
|
32
32
|
if (timings.connect) {
|
|
33
33
|
timings.firstByte = firstByteTime - timings.connect;
|
|
34
34
|
}
|
|
35
|
-
// Decompress body
|
|
36
35
|
const encoding = parsed.headers.get('content-encoding');
|
|
37
36
|
let body;
|
|
38
37
|
if (encoding) {
|
|
@@ -41,7 +40,6 @@ export async function sendH1Request(stream, request, options = {}, timings = {})
|
|
|
41
40
|
else {
|
|
42
41
|
body = parsed.body;
|
|
43
42
|
}
|
|
44
|
-
// Build response headers
|
|
45
43
|
const responseHeaders = {};
|
|
46
44
|
for (const [k, v] of parsed.headers) {
|
|
47
45
|
responseHeaders[k] = v;
|
|
@@ -60,7 +58,72 @@ export async function sendH1Request(stream, request, options = {}, timings = {})
|
|
|
60
58
|
connect: timings.connect ?? 0,
|
|
61
59
|
tls: timings.tls ?? 0,
|
|
62
60
|
firstByte: timings.firstByte ?? 0,
|
|
63
|
-
total: 0,
|
|
61
|
+
total: 0,
|
|
62
|
+
},
|
|
63
|
+
request: {
|
|
64
|
+
url: request.url,
|
|
65
|
+
method: request.method ?? 'GET',
|
|
66
|
+
headers: request.headers ?? {},
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Sends an HTTP/1.1 request over the given duplex stream and returns a
|
|
72
|
+
* streaming response whose body is available as a `Readable` stream on
|
|
73
|
+
* `response.body`. The headers are fully parsed before resolving;
|
|
74
|
+
* the body is streamed asynchronously.
|
|
75
|
+
*
|
|
76
|
+
* @param {Duplex} stream - Connected transport stream.
|
|
77
|
+
* @param {NLcURLRequest} request - Request descriptor.
|
|
78
|
+
* @param {H1ClientOptions} [options={}] - Client options.
|
|
79
|
+
* @param {Partial<RequestTimings>} [timings={}] - Partial timings object to populate with `firstByte`.
|
|
80
|
+
* @returns {Promise<NLcURLResponse>} Resolves once headers are received; body is streamed via `response.body`.
|
|
81
|
+
* @throws {HTTPError} If the connection is closed before headers are received.
|
|
82
|
+
* @throws {TimeoutError} If the response timeout is exceeded.
|
|
83
|
+
*/
|
|
84
|
+
export async function sendH1StreamingRequest(stream, request, options = {}, timings = {}) {
|
|
85
|
+
const encoded = encodeRequest(request, options.defaultHeaders ?? []);
|
|
86
|
+
await new Promise((resolve, reject) => {
|
|
87
|
+
stream.write(encoded, (err) => {
|
|
88
|
+
if (err)
|
|
89
|
+
reject(new HTTPError(err.message, 0));
|
|
90
|
+
else
|
|
91
|
+
resolve();
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
const parser = new HttpResponseParser(request.method ?? 'GET');
|
|
95
|
+
const bodyStream = new PassThrough();
|
|
96
|
+
parser.onBodyChunk = (chunk) => {
|
|
97
|
+
bodyStream.write(chunk);
|
|
98
|
+
};
|
|
99
|
+
const headersMeta = await readStreamingHeaders(stream, parser, request, bodyStream);
|
|
100
|
+
const firstByteTime = Date.now();
|
|
101
|
+
if (timings.connect) {
|
|
102
|
+
timings.firstByte = firstByteTime - timings.connect;
|
|
103
|
+
}
|
|
104
|
+
const responseHeaders = {};
|
|
105
|
+
for (const [k, v] of headersMeta.headers) {
|
|
106
|
+
responseHeaders[k] = v;
|
|
107
|
+
}
|
|
108
|
+
const encoding = headersMeta.headers.get('content-encoding');
|
|
109
|
+
const decompressor = createDecompressStream(encoding);
|
|
110
|
+
const outputStream = decompressor ? bodyStream.pipe(decompressor) : bodyStream;
|
|
111
|
+
return new NLcURLResponse({
|
|
112
|
+
status: headersMeta.statusCode,
|
|
113
|
+
statusText: headersMeta.statusMessage,
|
|
114
|
+
headers: responseHeaders,
|
|
115
|
+
rawHeaders: headersMeta.rawHeaders.map(([k, v]) => [k.toLowerCase(), v]),
|
|
116
|
+
rawBody: Buffer.alloc(0),
|
|
117
|
+
body: outputStream,
|
|
118
|
+
httpVersion: headersMeta.httpVersion,
|
|
119
|
+
url: request.url,
|
|
120
|
+
redirectCount: 0,
|
|
121
|
+
timings: {
|
|
122
|
+
dns: timings.dns ?? 0,
|
|
123
|
+
connect: timings.connect ?? 0,
|
|
124
|
+
tls: timings.tls ?? 0,
|
|
125
|
+
firstByte: timings.firstByte ?? 0,
|
|
126
|
+
total: 0,
|
|
64
127
|
},
|
|
65
128
|
request: {
|
|
66
129
|
url: request.url,
|
|
@@ -69,7 +132,6 @@ export async function sendH1Request(stream, request, options = {}, timings = {})
|
|
|
69
132
|
},
|
|
70
133
|
});
|
|
71
134
|
}
|
|
72
|
-
// ---- Internals ----
|
|
73
135
|
function readResponse(stream, parser, request) {
|
|
74
136
|
return new Promise((resolve, reject) => {
|
|
75
137
|
let settled = false;
|
|
@@ -133,4 +195,79 @@ function readResponse(stream, parser, request) {
|
|
|
133
195
|
stream.once('error', onError);
|
|
134
196
|
});
|
|
135
197
|
}
|
|
198
|
+
function readStreamingHeaders(stream, parser, request, bodyStream) {
|
|
199
|
+
return new Promise((resolve, reject) => {
|
|
200
|
+
let settled = false;
|
|
201
|
+
let headersResolved = false;
|
|
202
|
+
let timer;
|
|
203
|
+
const timeout = request.timeout;
|
|
204
|
+
const timeoutMs = typeof timeout === 'number' ? timeout : (timeout?.total ?? timeout?.response ?? 0);
|
|
205
|
+
if (timeoutMs > 0) {
|
|
206
|
+
timer = setTimeout(() => {
|
|
207
|
+
if (!settled) {
|
|
208
|
+
settled = true;
|
|
209
|
+
cleanup();
|
|
210
|
+
bodyStream.destroy(new TimeoutError('Response timed out', 'response'));
|
|
211
|
+
reject(new TimeoutError('Response timed out', 'response'));
|
|
212
|
+
}
|
|
213
|
+
}, timeoutMs);
|
|
214
|
+
}
|
|
215
|
+
const onData = (chunk) => {
|
|
216
|
+
try {
|
|
217
|
+
const done = parser.feed(chunk);
|
|
218
|
+
if (!headersResolved && parser.headersParsed) {
|
|
219
|
+
headersResolved = true;
|
|
220
|
+
resolve(parser.getHeadersResult());
|
|
221
|
+
}
|
|
222
|
+
if (done) {
|
|
223
|
+
settled = true;
|
|
224
|
+
cleanup();
|
|
225
|
+
bodyStream.end();
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
catch (err) {
|
|
229
|
+
settled = true;
|
|
230
|
+
cleanup();
|
|
231
|
+
bodyStream.destroy(err instanceof Error ? err : new Error(String(err)));
|
|
232
|
+
if (!headersResolved)
|
|
233
|
+
reject(err);
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
const onEnd = () => {
|
|
237
|
+
if (!settled) {
|
|
238
|
+
settled = true;
|
|
239
|
+
parser.connectionClosed();
|
|
240
|
+
cleanup();
|
|
241
|
+
if (!headersResolved) {
|
|
242
|
+
try {
|
|
243
|
+
resolve(parser.getHeadersResult());
|
|
244
|
+
}
|
|
245
|
+
catch {
|
|
246
|
+
reject(new HTTPError('Connection closed before headers complete', 0));
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
bodyStream.end();
|
|
250
|
+
}
|
|
251
|
+
};
|
|
252
|
+
const onError = (err) => {
|
|
253
|
+
if (!settled) {
|
|
254
|
+
settled = true;
|
|
255
|
+
cleanup();
|
|
256
|
+
bodyStream.destroy(err);
|
|
257
|
+
if (!headersResolved)
|
|
258
|
+
reject(new HTTPError(err.message, 0));
|
|
259
|
+
}
|
|
260
|
+
};
|
|
261
|
+
const cleanup = () => {
|
|
262
|
+
if (timer)
|
|
263
|
+
clearTimeout(timer);
|
|
264
|
+
stream.removeListener('data', onData);
|
|
265
|
+
stream.removeListener('end', onEnd);
|
|
266
|
+
stream.removeListener('error', onError);
|
|
267
|
+
};
|
|
268
|
+
stream.on('data', onData);
|
|
269
|
+
stream.once('end', onEnd);
|
|
270
|
+
stream.once('error', onError);
|
|
271
|
+
});
|
|
272
|
+
}
|
|
136
273
|
//# sourceMappingURL=client.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/http/h1/client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../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