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');