curl-wrap 1.0.4 → 2.0.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/README.md +3 -1
- package/index.d.ts +3 -3
- package/index.js +178 -62
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -88,13 +88,15 @@ curl.apiToken('your-api-token');
|
|
|
88
88
|
|
|
89
89
|
### Impersonating a Browser
|
|
90
90
|
|
|
91
|
-
**NOTE**: it will use `curl-impersonate
|
|
91
|
+
> **NOTE**: it will use `curl-impersonate` if it is in `PATH`.
|
|
92
|
+
> **See**: `https://github.com/lexiforest/curl-impersonate`
|
|
92
93
|
|
|
93
94
|
```js
|
|
94
95
|
curl.impersonate('chrome');
|
|
95
96
|
curl.impersonate('chromeMobile');
|
|
96
97
|
curl.impersonate('firefox');
|
|
97
98
|
curl.impersonate('safari');
|
|
99
|
+
curl.impersonate('safariMobile');
|
|
98
100
|
curl.impersonate('edge');
|
|
99
101
|
```
|
|
100
102
|
|
package/index.d.ts
CHANGED
|
@@ -28,7 +28,8 @@ type BrowserType =
|
|
|
28
28
|
| "edge"
|
|
29
29
|
| "chromeMobile"
|
|
30
30
|
| "firefox"
|
|
31
|
-
| "safari"
|
|
31
|
+
| "safari"
|
|
32
|
+
| "safariMobile";
|
|
32
33
|
|
|
33
34
|
export class Curl {
|
|
34
35
|
constructor();
|
|
@@ -48,8 +49,7 @@ export class Curl {
|
|
|
48
49
|
static getNewCookieJar(...args: any[]): CookieJar;
|
|
49
50
|
static getGlobalCookieJar(): CookieJar;
|
|
50
51
|
|
|
51
|
-
static
|
|
52
|
-
static hasCurlImpersonateFirefox(): boolean;
|
|
52
|
+
static hasCurlImpersonate(): boolean;
|
|
53
53
|
|
|
54
54
|
cliCommand(command: string): Curl;
|
|
55
55
|
cliOptions(options: string | string[]): Curl;
|
package/index.js
CHANGED
|
@@ -2,12 +2,6 @@ const {spawn, spawnSync} = require('child_process');
|
|
|
2
2
|
const fs = require('fs/promises');
|
|
3
3
|
const {CookieJar} = require('tough-cookie');
|
|
4
4
|
|
|
5
|
-
function getDefaultProxyPort(proxyType) {
|
|
6
|
-
if (proxyType === 'http') return 80;
|
|
7
|
-
if (proxyType === 'https') return 443;
|
|
8
|
-
return 1080;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
5
|
/**
|
|
12
6
|
* Returns proxy url based on the proxy options.
|
|
13
7
|
*
|
|
@@ -27,15 +21,23 @@ function makeProxyUrl(proxy, options) {
|
|
|
27
21
|
}
|
|
28
22
|
|
|
29
23
|
const auth = proxy.auth || options.auth || {};
|
|
30
|
-
const uri = new URL(
|
|
24
|
+
const uri = new URL(address);
|
|
31
25
|
if (!uri.port) {
|
|
32
|
-
|
|
26
|
+
const port = proxy.port || options.port;
|
|
27
|
+
if (port) {
|
|
28
|
+
uri.port = port;
|
|
29
|
+
}
|
|
30
|
+
else if (uri.protocol.startsWith('socks')) {
|
|
31
|
+
uri.port = '1080';
|
|
32
|
+
}
|
|
33
33
|
}
|
|
34
|
-
if (!uri.username
|
|
35
|
-
|
|
34
|
+
if (!uri.username) {
|
|
35
|
+
const username = proxy.username || options.username || auth.username;
|
|
36
|
+
if (username) uri.username = username;
|
|
36
37
|
}
|
|
37
|
-
if (!uri.password
|
|
38
|
-
|
|
38
|
+
if (!uri.password) {
|
|
39
|
+
const password = proxy.password || options.password || auth.password;
|
|
40
|
+
if (password) uri.password = password;
|
|
39
41
|
}
|
|
40
42
|
return uri.toString();
|
|
41
43
|
}
|
|
@@ -115,7 +117,7 @@ class Curl {
|
|
|
115
117
|
// 'sec-fetch-mode': 'navigate',
|
|
116
118
|
// 'sec-fetch-site': 'same-origin',
|
|
117
119
|
// 'upgrade-insecure-requests': 1,
|
|
118
|
-
'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/
|
|
120
|
+
'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36',
|
|
119
121
|
},
|
|
120
122
|
// whether to follow redirects
|
|
121
123
|
followRedirect: true,
|
|
@@ -252,25 +254,13 @@ class Curl {
|
|
|
252
254
|
/**
|
|
253
255
|
* @static
|
|
254
256
|
* whether curl-impersonate-chrome is available or not
|
|
255
|
-
* @see https://github.com/
|
|
257
|
+
* @see https://github.com/lexiforest/curl-impersonate
|
|
256
258
|
*/
|
|
257
|
-
static
|
|
258
|
-
if (this.
|
|
259
|
-
this.
|
|
259
|
+
static hasCurlImpersonate() {
|
|
260
|
+
if (this._hasCurlImpersonate === undefined) {
|
|
261
|
+
this._hasCurlImpersonate = spawnSync('curl-impersonate', ['--version']).status === 0;
|
|
260
262
|
}
|
|
261
|
-
return this.
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
/**
|
|
265
|
-
* @static
|
|
266
|
-
* whether curl-impersonate-ff is available or not
|
|
267
|
-
* @see https://github.com/lwthiker/curl-impersonate
|
|
268
|
-
*/
|
|
269
|
-
static hasCurlImpersonateFirefox() {
|
|
270
|
-
if (this._hasCurlImpersonateFirefox === undefined) {
|
|
271
|
-
this._hasCurlImpersonateFirefox = spawnSync('curl-impersonate-ff', ['--version']).status === 0;
|
|
272
|
-
}
|
|
273
|
-
return this._hasCurlImpersonateFirefox;
|
|
263
|
+
return this._hasCurlImpersonate;
|
|
274
264
|
}
|
|
275
265
|
|
|
276
266
|
/**
|
|
@@ -304,82 +294,124 @@ class Curl {
|
|
|
304
294
|
/**
|
|
305
295
|
* impersonate a browser
|
|
306
296
|
*
|
|
307
|
-
* @param {string} browser browser to impersonate (chrome / chromeMobile / edge / safari / firefox)
|
|
297
|
+
* @param {string} browser browser to impersonate (chrome / chromeMobile / edge / safari / safariMobile / firefox)
|
|
308
298
|
* @return {Curl} self
|
|
309
299
|
*/
|
|
310
300
|
impersonate(browser = 'chrome') {
|
|
311
301
|
if (browser === 'chrome') {
|
|
312
|
-
if (this.constructor.
|
|
313
|
-
this.cliCommand('curl-impersonate
|
|
302
|
+
if (this.constructor.hasCurlImpersonate()) {
|
|
303
|
+
this.cliCommand('curl-impersonate');
|
|
314
304
|
this.cliOptions([
|
|
315
305
|
'--ciphers',
|
|
316
306
|
'TLS_AES_128_GCM_SHA256,TLS_AES_256_GCM_SHA384,TLS_CHACHA20_POLY1305_SHA256,ECDHE-ECDSA-AES128-GCM-SHA256,ECDHE-RSA-AES128-GCM-SHA256,ECDHE-ECDSA-AES256-GCM-SHA384,ECDHE-RSA-AES256-GCM-SHA384,ECDHE-ECDSA-CHACHA20-POLY1305,ECDHE-RSA-CHACHA20-POLY1305,ECDHE-RSA-AES128-SHA,ECDHE-RSA-AES256-SHA,AES128-GCM-SHA256,AES256-GCM-SHA384,AES128-SHA,AES256-SHA',
|
|
307
|
+
'--curves',
|
|
308
|
+
'X25519MLKEM768:X25519:P-256:P-384',
|
|
317
309
|
'--http2',
|
|
318
|
-
'--http2-
|
|
310
|
+
'--http2-settings',
|
|
311
|
+
'1:65536;2:0;4:6291456;6:262144',
|
|
312
|
+
'--http2-window-update',
|
|
313
|
+
'15663105',
|
|
314
|
+
'--http2-stream-weight',
|
|
315
|
+
'256',
|
|
316
|
+
'--http2-stream-exclusive',
|
|
317
|
+
'1',
|
|
319
318
|
'--compressed',
|
|
319
|
+
'--ech',
|
|
320
|
+
'grease',
|
|
320
321
|
'--tlsv1.2',
|
|
321
322
|
'--alps',
|
|
322
323
|
'--tls-permute-extensions',
|
|
323
324
|
'--cert-compression',
|
|
324
325
|
'brotli',
|
|
326
|
+
'--tls-grease',
|
|
327
|
+
'--tls-use-new-alps-codepoint',
|
|
328
|
+
'--tls-signed-cert-timestamps',
|
|
325
329
|
]);
|
|
326
330
|
}
|
|
327
331
|
this.headers({
|
|
328
|
-
'sec-ch-ua': '"
|
|
332
|
+
'sec-ch-ua': '"Google Chrome";v="137", "Chromium";v="137", "Not/A)Brand";v="24"',
|
|
329
333
|
'sec-ch-ua-mobile': '?0',
|
|
330
|
-
'sec-ch-ua-platform': '"
|
|
334
|
+
'sec-ch-ua-platform': '"macOS"',
|
|
331
335
|
'Upgrade-Insecure-Requests': '1',
|
|
332
|
-
'User-Agent': 'Mozilla/5.0 (
|
|
336
|
+
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36',
|
|
333
337
|
Accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
|
|
334
338
|
'Sec-Fetch-Site': 'none',
|
|
335
339
|
'Sec-Fetch-Mode': 'navigate',
|
|
336
340
|
'Sec-Fetch-User': '?1',
|
|
337
341
|
'Sec-Fetch-Dest': 'document',
|
|
338
|
-
'Accept-Encoding': 'gzip, deflate, br',
|
|
342
|
+
'Accept-Encoding': 'gzip, deflate, br, zstd',
|
|
339
343
|
'Accept-Language': 'en-US,en;q=0.9',
|
|
344
|
+
'Priority': 'u=0, i',
|
|
340
345
|
});
|
|
341
346
|
}
|
|
342
347
|
else if (browser === 'chromeMobile') {
|
|
343
|
-
if (this.constructor.
|
|
344
|
-
this.cliCommand('curl-impersonate
|
|
348
|
+
if (this.constructor.hasCurlImpersonate()) {
|
|
349
|
+
this.cliCommand('curl-impersonate');
|
|
345
350
|
this.cliOptions([
|
|
346
351
|
'--ciphers',
|
|
347
352
|
'TLS_AES_128_GCM_SHA256,TLS_AES_256_GCM_SHA384,TLS_CHACHA20_POLY1305_SHA256,ECDHE-ECDSA-AES128-GCM-SHA256,ECDHE-RSA-AES128-GCM-SHA256,ECDHE-ECDSA-AES256-GCM-SHA384,ECDHE-RSA-AES256-GCM-SHA384,ECDHE-ECDSA-CHACHA20-POLY1305,ECDHE-RSA-CHACHA20-POLY1305,ECDHE-RSA-AES128-SHA,ECDHE-RSA-AES256-SHA,AES128-GCM-SHA256,AES256-GCM-SHA384,AES128-SHA,AES256-SHA',
|
|
353
|
+
'--curves',
|
|
354
|
+
'X25519:P-256:P-384',
|
|
348
355
|
'--http2',
|
|
356
|
+
'--http2-settings',
|
|
357
|
+
'1:65536;2:0;4:6291456;6:262144',
|
|
358
|
+
'--http2-window-update',
|
|
359
|
+
'15663105',
|
|
360
|
+
'--http2-stream-weight',
|
|
361
|
+
'256',
|
|
362
|
+
'--http2-stream-exclusive',
|
|
363
|
+
'1',
|
|
349
364
|
'--compressed',
|
|
365
|
+
'--ech',
|
|
366
|
+
'grease',
|
|
350
367
|
'--tlsv1.2',
|
|
351
368
|
'--alps',
|
|
369
|
+
'--tls-permute-extensions',
|
|
352
370
|
'--cert-compression',
|
|
353
371
|
'brotli',
|
|
372
|
+
'--tls-grease',
|
|
373
|
+
'--tls-use-new-alps-codepoint',
|
|
374
|
+
'--tls-signed-cert-timestamps',
|
|
354
375
|
]);
|
|
355
376
|
}
|
|
356
377
|
this.headers({
|
|
357
|
-
'sec-ch-ua': '
|
|
358
|
-
'sec-ch-ua-mobile': '?
|
|
378
|
+
'sec-ch-ua': 'Google Chrome";v="137", "Chromium";v="137", "Not_A Brand";v="24"',
|
|
379
|
+
'sec-ch-ua-mobile': '?0',
|
|
359
380
|
'sec-ch-ua-platform': '"Android"',
|
|
360
381
|
'Upgrade-Insecure-Requests': '1',
|
|
361
|
-
'User-Agent': 'Mozilla/5.0 (Linux; Android 12; Pixel 6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/
|
|
362
|
-
Accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.
|
|
382
|
+
'User-Agent': 'Mozilla/5.0 (Linux; Android 12; Pixel 6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Mobile Safari/537.36',
|
|
383
|
+
Accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
|
|
363
384
|
'Sec-Fetch-Site': 'none',
|
|
364
385
|
'Sec-Fetch-Mode': 'navigate',
|
|
365
386
|
'Sec-Fetch-User': '?1',
|
|
366
387
|
'Sec-Fetch-Dest': 'document',
|
|
367
|
-
'Accept-Encoding': 'gzip, deflate, br',
|
|
388
|
+
'Accept-Encoding': 'gzip, deflate, br, zstd',
|
|
368
389
|
'Accept-Language': 'en-US,en;q=0.9',
|
|
390
|
+
'Priority': 'u=0, i',
|
|
369
391
|
});
|
|
370
392
|
}
|
|
371
393
|
else if (browser === 'edge') {
|
|
372
|
-
if (this.constructor.
|
|
373
|
-
this.cliCommand('curl-impersonate
|
|
394
|
+
if (this.constructor.hasCurlImpersonate()) {
|
|
395
|
+
this.cliCommand('curl-impersonate');
|
|
374
396
|
this.cliOptions([
|
|
375
397
|
'--ciphers',
|
|
376
398
|
'TLS_AES_128_GCM_SHA256,TLS_AES_256_GCM_SHA384,TLS_CHACHA20_POLY1305_SHA256,ECDHE-ECDSA-AES128-GCM-SHA256,ECDHE-RSA-AES128-GCM-SHA256,ECDHE-ECDSA-AES256-GCM-SHA384,ECDHE-RSA-AES256-GCM-SHA384,ECDHE-ECDSA-CHACHA20-POLY1305,ECDHE-RSA-CHACHA20-POLY1305,ECDHE-RSA-AES128-SHA,ECDHE-RSA-AES256-SHA,AES128-GCM-SHA256,AES256-GCM-SHA384,AES128-SHA,AES256-SHA',
|
|
377
399
|
'--http2',
|
|
400
|
+
'--http2-settings',
|
|
401
|
+
'1:65536;3:1000;4:6291456;6:262144',
|
|
402
|
+
'--http2-window-update',
|
|
403
|
+
'15663105',
|
|
404
|
+
'--http2-stream-weight',
|
|
405
|
+
'256',
|
|
406
|
+
'--http2-stream-exclusive',
|
|
407
|
+
'1',
|
|
378
408
|
'--compressed',
|
|
379
409
|
'--tlsv1.2',
|
|
380
410
|
'--alps',
|
|
381
411
|
'--cert-compression',
|
|
382
412
|
'brotli',
|
|
413
|
+
'--tls-grease',
|
|
414
|
+
'--tls-signed-cert-timestamps',
|
|
383
415
|
]);
|
|
384
416
|
}
|
|
385
417
|
this.headers({
|
|
@@ -398,53 +430,137 @@ class Curl {
|
|
|
398
430
|
});
|
|
399
431
|
}
|
|
400
432
|
else if (browser === 'safari') {
|
|
401
|
-
if (this.constructor.
|
|
402
|
-
this.cliCommand('curl-impersonate
|
|
433
|
+
if (this.constructor.hasCurlImpersonate()) {
|
|
434
|
+
this.cliCommand('curl-impersonate');
|
|
403
435
|
this.cliOptions([
|
|
404
436
|
'--ciphers',
|
|
405
437
|
'TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384:TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256:TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256:TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384:TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256:TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256:TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA:TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA:TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA:TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA:TLS_RSA_WITH_AES_256_GCM_SHA384:TLS_RSA_WITH_AES_128_GCM_SHA256:TLS_RSA_WITH_AES_256_CBC_SHA:TLS_RSA_WITH_AES_128_CBC_SHA:TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA:TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA:TLS_RSA_WITH_3DES_EDE_CBC_SHA',
|
|
406
438
|
'--curves',
|
|
407
439
|
'X25519:P-256:P-384:P-521',
|
|
408
440
|
'--signature-hashes',
|
|
409
|
-
'ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256,rsa_pkcs1_sha256,ecdsa_secp384r1_sha384,
|
|
441
|
+
'ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256,rsa_pkcs1_sha256,ecdsa_secp384r1_sha384,rsa_pss_rsae_sha384,rsa_pss_rsae_sha384,rsa_pkcs1_sha384,rsa_pss_rsae_sha512,rsa_pkcs1_sha512,rsa_pkcs1_sha1',
|
|
410
442
|
'--http2',
|
|
443
|
+
'--http2-settings',
|
|
444
|
+
'2:0;3:100;4:2097152;9:1',
|
|
445
|
+
'--http2-pseudo-headers-order',
|
|
446
|
+
'msap',
|
|
447
|
+
'--http2-window-update',
|
|
448
|
+
'10420225',
|
|
449
|
+
'--http2-stream-weight',
|
|
450
|
+
'256',
|
|
451
|
+
'--http2-stream-exclusive',
|
|
452
|
+
'0',
|
|
411
453
|
'--compressed',
|
|
412
454
|
'--tlsv1.0',
|
|
413
455
|
'--no-tls-session-ticket',
|
|
414
456
|
'--cert-compression',
|
|
415
457
|
'zlib',
|
|
458
|
+
'--tls-grease',
|
|
459
|
+
'--tls-signed-cert-timestamps',
|
|
460
|
+
]);
|
|
461
|
+
}
|
|
462
|
+
this.headers({
|
|
463
|
+
'sec-fetch-dest': 'document',
|
|
464
|
+
'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.4 Safari/605.1.15',
|
|
465
|
+
accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
|
|
466
|
+
'sec-fetch-site': 'none',
|
|
467
|
+
'sec-fetch-mode': 'navigate',
|
|
468
|
+
'accept-language': 'en-US,en;q=0.9',
|
|
469
|
+
'priority': 'u=0, i',
|
|
470
|
+
'accept-encoding': 'gzip, deflate, br',
|
|
471
|
+
});
|
|
472
|
+
}
|
|
473
|
+
else if (browser === 'safariMobile') {
|
|
474
|
+
if (this.constructor.hasCurlImpersonate()) {
|
|
475
|
+
this.cliCommand('curl-impersonate');
|
|
476
|
+
this.cliOptions([
|
|
477
|
+
'--ciphers',
|
|
478
|
+
'TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384:TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256:TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256:TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384:TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256:TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256:TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA:TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA:TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA:TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA:TLS_RSA_WITH_AES_256_GCM_SHA384:TLS_RSA_WITH_AES_128_GCM_SHA256:TLS_RSA_WITH_AES_256_CBC_SHA:TLS_RSA_WITH_AES_128_CBC_SHA:TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA:TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA:TLS_RSA_WITH_3DES_EDE_CBC_SHA',
|
|
479
|
+
'--curves',
|
|
480
|
+
'X25519:P-256:P-384:P-521',
|
|
481
|
+
'--signature-hashes',
|
|
482
|
+
'ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256,rsa_pkcs1_sha256,ecdsa_secp384r1_sha384,rsa_pss_rsae_sha384,rsa_pss_rsae_sha384,rsa_pkcs1_sha384,rsa_pss_rsae_sha512,rsa_pkcs1_sha512,rsa_pkcs1_sha1',
|
|
483
|
+
'--http2',
|
|
484
|
+
'--http2-settings',
|
|
485
|
+
'2:0;3:100;4:2097152;9:1',
|
|
416
486
|
'--http2-pseudo-headers-order',
|
|
417
|
-
'
|
|
487
|
+
'msap',
|
|
488
|
+
'--http2-window-update',
|
|
489
|
+
'10420225',
|
|
490
|
+
'--http2-stream-weight',
|
|
491
|
+
'256',
|
|
492
|
+
'--http2-stream-exclusive',
|
|
493
|
+
'0',
|
|
494
|
+
'--compressed',
|
|
495
|
+
'--tlsv1.0',
|
|
496
|
+
'--no-tls-session-ticket',
|
|
497
|
+
'--cert-compression',
|
|
498
|
+
'zlib',
|
|
499
|
+
'--tls-grease',
|
|
500
|
+
'--tls-signed-cert-timestamps',
|
|
418
501
|
]);
|
|
419
502
|
}
|
|
420
503
|
this.headers({
|
|
421
|
-
'
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
'
|
|
504
|
+
'sec-fetch-dest': 'document',
|
|
505
|
+
'user-agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 18_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.4 Mobile/15E148 Safari/604.1',
|
|
506
|
+
accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
|
|
507
|
+
'sec-fetch-site': 'none',
|
|
508
|
+
'sec-fetch-mode': 'navigate',
|
|
509
|
+
'accept-language': 'en-US,en;q=0.9',
|
|
510
|
+
'priority': 'u=0, i',
|
|
511
|
+
'accept-encoding': 'gzip, deflate, br',
|
|
425
512
|
});
|
|
426
513
|
}
|
|
427
514
|
else if (browser === 'firefox') {
|
|
428
|
-
if (this.constructor.
|
|
429
|
-
this.cliCommand('curl-impersonate
|
|
515
|
+
if (this.constructor.hasCurlImpersonate()) {
|
|
516
|
+
this.cliCommand('curl-impersonate');
|
|
430
517
|
this.cliOptions([
|
|
431
518
|
'--ciphers',
|
|
432
|
-
'
|
|
519
|
+
'TLS_AES_128_GCM_SHA256,TLS_CHACHA20_POLY1305_SHA256,TLS_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256,TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,TLS_RSA_WITH_AES_128_GCM_SHA256,TLS_RSA_WITH_AES_256_GCM_SHA384,TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA',
|
|
520
|
+
'--curves',
|
|
521
|
+
'X25519MLKEM768:X25519:P-256:P-384:P-521:ffdhe2048:ffdhe3072',
|
|
522
|
+
'--signature-hashes',
|
|
523
|
+
'ecdsa_secp256r1_sha256,ecdsa_secp384r1_sha384,ecdsa_secp521r1_sha512,rsa_pss_rsae_sha256,rsa_pss_rsae_sha384,rsa_pss_rsae_sha512,rsa_pkcs1_sha256,rsa_pkcs1_sha384,rsa_pkcs1_sha512,ecdsa_sha1,rsa_pkcs1_sha1',
|
|
433
524
|
'--http2',
|
|
525
|
+
'--http2-settings',
|
|
526
|
+
'1:65536;2:0;4:131072;5:16384',
|
|
527
|
+
'--http2-pseudo-headers-order',
|
|
528
|
+
'msap',
|
|
529
|
+
'--http2-window-update',
|
|
530
|
+
'12517377',
|
|
531
|
+
'--http2-stream-weight',
|
|
532
|
+
'42',
|
|
533
|
+
'--http2-stream-exclusive',
|
|
534
|
+
'0',
|
|
434
535
|
'--compressed',
|
|
536
|
+
'--ech',
|
|
537
|
+
'grease',
|
|
538
|
+
'--tls-extension-order',
|
|
539
|
+
'0-23-65281-10-11-35-16-5-34-18-51-43-13-45-28-27-65037',
|
|
540
|
+
'--tls-delegated-credentials',
|
|
541
|
+
'ecdsa_secp256r1_sha256:ecdsa_secp384r1_sha384:ecdsa_secp521r1_sha512:ecdsa_sha1',
|
|
542
|
+
'--tls-record-size-limit',
|
|
543
|
+
'4001',
|
|
544
|
+
'--tls-key-shares-limit',
|
|
545
|
+
'3',
|
|
546
|
+
'--cert-compression',
|
|
547
|
+
'zlib,brotli,zstd',
|
|
548
|
+
'--tls-signed-cert-timestamps',
|
|
549
|
+
'--tls-use-firefox-tls13-ciphers',
|
|
435
550
|
]);
|
|
436
551
|
}
|
|
437
552
|
this.headers({
|
|
438
|
-
'User-Agent': 'Mozilla/5.0 (
|
|
439
|
-
Accept: 'text/html,application/xhtml+xml,application/xml;q=0.9
|
|
553
|
+
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:135.0) Gecko/20100101 Firefox/135.0',
|
|
554
|
+
Accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
|
|
440
555
|
'Accept-Language': 'en-US,en;q=0.5',
|
|
441
|
-
'Accept-Encoding': 'gzip, deflate, br',
|
|
556
|
+
'Accept-Encoding': 'gzip, deflate, br, zstd',
|
|
442
557
|
'Upgrade-Insecure-Requests': '1',
|
|
443
558
|
'Sec-Fetch-Dest': 'document',
|
|
444
559
|
'Sec-Fetch-Mode': 'navigate',
|
|
445
560
|
'Sec-Fetch-Site': 'none',
|
|
446
561
|
'Sec-Fetch-User': '?1',
|
|
447
|
-
|
|
562
|
+
'Priority': 'u=0, i',
|
|
563
|
+
'TE': 'trailers',
|
|
448
564
|
});
|
|
449
565
|
}
|
|
450
566
|
return this;
|