From 4998901c09a9388f00321b21714d25c1c0f7dd5d Mon Sep 17 00:00:00 2001 From: caorushizi <84996057@qq.com> Date: Mon, 7 Oct 2024 11:51:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20=20mac=20build=20&=20down?= =?UTF-8?q?load=20progress?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 2 +- packages/backend/src/vendor/SocketIO.ts | 4 ++++ packages/renderer/src/utils/socket.ts | 6 +++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 567e4b35..a8cb11b3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,7 +24,7 @@ jobs: strategy: fail-fast: false matrix: - os: [windows-latest, macos-14-large, ubuntu-latest] + os: [windows-latest, macos-13, ubuntu-latest] # create steps steps: diff --git a/packages/backend/src/vendor/SocketIO.ts b/packages/backend/src/vendor/SocketIO.ts index dddc782b..780ceae5 100644 --- a/packages/backend/src/vendor/SocketIO.ts +++ b/packages/backend/src/vendor/SocketIO.ts @@ -34,6 +34,10 @@ export default class SocketIO implements Vendor { }, }); + this.io.engine.on("headers", (headers) => { + headers["Access-Control-Allow-Private-Network"] = true; + }); + this.io.on("connection", () => {}); this.downloadService.on("download-ready-start", this.onDownloadReadyStart); diff --git a/packages/renderer/src/utils/socket.ts b/packages/renderer/src/utils/socket.ts index 8577d0de..700c5015 100644 --- a/packages/renderer/src/utils/socket.ts +++ b/packages/renderer/src/utils/socket.ts @@ -6,7 +6,11 @@ export function getSocket() { return _instance; } - _instance = io("http://localhost:8899"); + _instance = io("http://localhost:8899", { + extraHeaders: { + "Access-Control-Request-Private-Network": "true", + }, + }); return _instance; }