From 5ca1ed5f8d7a0dddfde33944caa700d9dc8e05cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A7=89?= Date: Sun, 1 Oct 2023 12:55:42 +0800 Subject: [PATCH] =?UTF-8?q?TURN=20=E6=9C=8D=E5=8A=A1=E5=99=A8:=20DEBUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 4 ++-- public/client.js | 11 +++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/index.js b/index.js index 113f05f..c137240 100644 --- a/index.js +++ b/index.js @@ -11,9 +11,9 @@ const turnServer = new turn({ password: 'your-password', }, debugLevel: 'ALL', - listeningIps: [''], + listeningIps: ['0.0.0.0'], listeningPort: 3478, - relayIps: [''], + relayIps: ['0.0.0.0'], relayPort: 3478, verbose: true }) diff --git a/public/client.js b/public/client.js index e9ac147..03867be 100644 --- a/public/client.js +++ b/public/client.js @@ -114,13 +114,12 @@ export default class ClientList { } console.log('收到未知数据:', data) } - websocket.onclose = event => { + websocket.onclose = async event => { console.log('WebSocket 断线重连...') - setTimeout(() => { - //this.websocket = linkStart() - // 调试模式: 直接刷新页面重载 - window.location.reload() - }, 3000) + await new Promise(resolve => setTimeout(resolve, 10000)) + // this.websocket = linkStart() + // 调试模式: 直接刷新页面重载 + window.location.reload() } return websocket }