From 5f611d21921c73dd20436c8013640600f18600c3 Mon Sep 17 00:00:00 2001 From: Song367 <601337784@qq.com> Date: Tue, 30 Sep 2025 17:24:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server.js | 1 + src/index.js | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/server.js b/server.js index 9b6702e..e7a9dfc 100644 --- a/server.js +++ b/server.js @@ -9,6 +9,7 @@ const { MessageHistory } = require('./src/message_history.js'); const app = express(); const server = http.createServer(app); const io = socketIo(server, { + path: '/emotion-male-app/socket.io', pingTimeout: 300000, // 60秒超时 pingInterval: 25000, // 25秒心跳间隔 upgradeTimeout: 30000, // 30秒升级超时 diff --git a/src/index.js b/src/index.js index 0b01863..1f3b737 100644 --- a/src/index.js +++ b/src/index.js @@ -172,7 +172,9 @@ class WebRTCChat { } initializeSocket() { - this.socket = io(); + this.socket = io({ + path: '/emotion-male-app/socket.io' + }); this.socket.on('connect', () => { this.updateStatus('已连接到服务器', 'connected');