ソースを参照

Chore: disable IPv6 in fetch

SukkaW 1 年間 前
コミット
137426dc59
1 ファイル変更6 行追加0 行削除
  1. 6 0
      Build/lib/fetch-retry.ts

+ 6 - 0
Build/lib/fetch-retry.ts

@@ -26,6 +26,12 @@ if (!fs.existsSync(CACHE_DIR)) {
 const agent = new Agent({ allowH2: true });
 const agent = new Agent({ allowH2: true });
 
 
 setGlobalDispatcher(agent.compose(
 setGlobalDispatcher(agent.compose(
+  interceptors.dns({
+    // disable IPv6
+    dualStack: false,
+    affinity: 4
+    // TODO: proper cacheable-lookup, or even DoH
+  }),
   interceptors.retry({
   interceptors.retry({
     maxRetries: 5,
     maxRetries: 5,
     minTimeout: 500, // The initial retry delay in milliseconds
     minTimeout: 500, // The initial retry delay in milliseconds