Fix WS timeouts:

Nginx as also a timeout. Seems to be 30s. So we ping every 25s, and set an intermediate timeout for Prosody.
This commit is contained in:
John Livingston 2022-11-01 11:58:02 +01:00
parent 90e86a130a
commit a25cdb44ef
No known key found for this signature in database
GPG Key ID: B17B5640CE66CDBC
2 changed files with 3 additions and 2 deletions

View File

@ -138,7 +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
ping_interval: 25, // must be set accordingly to c2s_close_timeout backend websocket settings and nginx timeout
auto_login: true,
auto_join_rooms: [
room

View File

@ -217,7 +217,8 @@ 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
// c2s_close_timeout must be set accordingly with ConverseJS ping_interval (25s) and nginx timeout (30s)
this.global.set('c2s_close_timeout', 29)
// This line seems to be required by Prosody, otherwise it rejects websocket...
this.global.set('cross_domain_websocket', [publicServerUrl])