mirror of
https://github.com/SukkaW/Surge.git
synced 2025-12-12 01:00:34 +08:00
12 lines
316 B
JavaScript
12 lines
316 B
JavaScript
// @ts-check
|
|
const undici = require('undici');
|
|
|
|
// Enable HTTP/2 supports
|
|
undici.setGlobalDispatcher(new undici.Agent({
|
|
allowH2: true,
|
|
pipelining: 10
|
|
}));
|
|
|
|
const fetchWithRetry = /** @type {import('undici').fetch} */(require('@vercel/fetch-retry')(undici.fetch));
|
|
module.exports.fetchWithRetry = fetchWithRetry;
|