Fix Websocket timeouts:

* defining a ping_interval in ConverseJS
* defining a longer c2s_close_timeout in Prosody configuration
This commit is contained in:
John Livingston 2022-11-01 11:37:24 +01:00
parent 6a54f4d747
commit 90e86a130a
No known key found for this signature in database
GPG Key ID: B17B5640CE66CDBC
2 changed files with 2 additions and 0 deletions

View File

@ -138,6 +138,7 @@ window.initConverse = async function initConverse ({
assets_path: assetsPath, assets_path: assetsPath,
authentication: 'anonymous', authentication: 'anonymous',
ping_interval: 60, // must be set accordingly to c2s_close_timeout backend websocket settings
auto_login: true, auto_login: true,
auto_join_rooms: [ auto_join_rooms: [
room room

View File

@ -217,6 +217,7 @@ class ProsodyConfigContent {
this.global.set('consider_bosh_secure', true) this.global.set('consider_bosh_secure', true)
if (useWS) { if (useWS) {
this.global.set('consider_websocket_secure', true) 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 line seems to be required by Prosody, otherwise it rejects websocket...
this.global.set('cross_domain_websocket', [publicServerUrl]) this.global.set('cross_domain_websocket', [publicServerUrl])