From 90e86a130a3de13fda5e9e4d2f592f364b626ba6 Mon Sep 17 00:00:00 2001 From: John Livingston Date: Tue, 1 Nov 2022 11:37:24 +0100 Subject: [PATCH] Fix Websocket timeouts: * defining a ping_interval in ConverseJS * defining a longer c2s_close_timeout in Prosody configuration --- conversejs/builtin.ts | 1 + server/lib/prosody/config/content.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/conversejs/builtin.ts b/conversejs/builtin.ts index f0adb689..43ce5dfe 100644 --- a/conversejs/builtin.ts +++ b/conversejs/builtin.ts @@ -138,6 +138,7 @@ window.initConverse = async function initConverse ({ assets_path: assetsPath, authentication: 'anonymous', + ping_interval: 60, // must be set accordingly to c2s_close_timeout backend websocket settings auto_login: true, auto_join_rooms: [ room diff --git a/server/lib/prosody/config/content.ts b/server/lib/prosody/config/content.ts index 4603b674..67fa19f8 100644 --- a/server/lib/prosody/config/content.ts +++ b/server/lib/prosody/config/content.ts @@ -217,6 +217,7 @@ class ProsodyConfigContent { this.global.set('consider_bosh_secure', true) if (useWS) { this.global.set('consider_websocket_secure', true) + this.global.set('c2s_close_timeout', 65) // must be set accordingly with ConverseJS ping_interval // This line seems to be required by Prosody, otherwise it rejects websocket... this.global.set('cross_domain_websocket', [publicServerUrl])