Skip to content

Commit 59b738e

Browse files
committed
fix: proxy url global setting
1 parent 8c07898 commit 59b738e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/test-utils.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ProxyAgent } from 'undici';
1+
import { ProxyAgent,setGlobalDispatcher } from 'undici';
22
import { Scraper } from './scraper';
33
import fs from 'fs';
44

@@ -96,6 +96,8 @@ export async function getScraper(
9696
}
9797

9898
agent = new ProxyAgent(agentOptions);
99+
100+
setGlobalDispatcher(agent)
99101
}
100102

101103
const scraper = new Scraper({

0 commit comments

Comments
 (0)