Skip to content

Commit b6380f2

Browse files
committed
feat: added sdk timeouts and dispatcher settings
1 parent 8934a93 commit b6380f2

File tree

5 files changed

+16
-3
lines changed

5 files changed

+16
-3
lines changed

bun.lock

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"async-mutex": "^0.5.0",
88
"delay": "^6.0.0",
99
"playwright": "^1.56.0",
10+
"undici": "^7.16.0",
1011
},
1112
"devDependencies": {
1213
"@types/bun": "latest",
@@ -293,6 +294,8 @@
293294

294295
"ufo": ["ufo@1.6.1", "", {}, "sha512-9a4/uxlTWJ4+a5i0ooc1rU7C7YOw3wT+UGqdeNNHWnOF9qcMBgLRS+4IYUqbczewFx4mLEig6gawh7X6mFlEkA=="],
295296

297+
"undici": ["undici@7.16.0", "", {}, "sha512-QEg3HPMll0o3t2ourKwOeUAZ159Kn9mx5pnzHRQO8+Wixmh88YdZRiIwat0iNzNNXn0yoEtXJqFpyW7eM8BV7g=="],
298+
296299
"undici-types": ["undici-types@7.14.0", "", {}, "sha512-QQiYxHuyZ9gQUIrmPo3IA+hUl4KYk8uSA7cHrcKd/l3p1OTpZcM0Tbp9x7FAtXdAYhlasd60ncPpgu6ihG6TOA=="],
297300

298301
"webidl-conversions": ["webidl-conversions@4.0.2", "", {}, "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg=="],

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737
"dependencies": {
3838
"async-mutex": "^0.5.0",
3939
"delay": "^6.0.0",
40-
"playwright": "^1.56.0"
40+
"playwright": "^1.56.0",
41+
"undici": "^7.16.0"
4142
},
4243
"publishConfig": {
4344
"access": "public"

src/handlers/datadome/handler.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ export default class DatadomeHandler extends SDKHelper {
3838

3939
const sdk = new DatadomeSDK({
4040
apiKey: config.apiKey,
41-
apiHost: config.apiHost
41+
apiHost: config.apiHost,
42+
...config.sdkConfig,
4243
});
4344

4445
const browser = await chromium.launch({

src/handlers/px/handler.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ export class PerimeterxHandler extends SDKHelper {
3333

3434
const sdk = new PerimeterxSDK({
3535
apiKey: config.apiKey,
36-
apiHost: config.apiHost
36+
apiHost: config.apiHost,
37+
...config.sdkConfig,
3738
});
3839

3940
const browser = await chromium.launch({

src/models/config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { ProxyAddress } from "parallax-sdk-ts";
2+
import type { Dispatcher } from "undici";
23

34
export type Config = {
45
apiKey: string,
@@ -7,4 +8,10 @@ export type Config = {
78
proxyRegion: string,
89
region: string,
910
site: string
11+
12+
sdkConfig: {
13+
timeout?: number
14+
bodyTimeout?: number
15+
dispatcher?: Dispatcher
16+
}
1017
};

0 commit comments

Comments
 (0)