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 }