mirror of
https://github.com/SukkaW/Surge.git
synced 2026-01-29 01:51:52 +08:00
Chore/Perf: fetch enable HTTP/2
This commit is contained in:
@@ -8,6 +8,7 @@ import process from 'node:process';
|
||||
|
||||
import { async as ezspawn } from '@jsdevtools/ez-spawn';
|
||||
import { mkdirp } from './misc';
|
||||
import { fetchWithRetry } from './fetch-retry';
|
||||
|
||||
const mihomoBinaryDir = path.join(__dirname, '../../node_modules/.cache/mihomo');
|
||||
const mihomoBinaryPath = path.join(mihomoBinaryDir, 'mihomo');
|
||||
@@ -32,7 +33,7 @@ const ensureMihomoBinary = async () => {
|
||||
throw new Error(`Unsupported platform: ${process.platform} ${process.arch}`);
|
||||
}
|
||||
|
||||
const res = await fetch(downloadUrl);
|
||||
const res = await fetchWithRetry(downloadUrl);
|
||||
|
||||
if (!res.ok || !res.body) {
|
||||
throw new Error(`Failed to download mihomo binary: ${res.statusText}`);
|
||||
|
||||
Reference in New Issue
Block a user