From 8fc3de416ceb299827b0461052e2a4a956e4438c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Mon, 16 Oct 2023 15:59:32 +0200 Subject: [PATCH] feat(config) add ability to prefer BOSH over WebSocket There might be cases where we'd want to enforce it. --- config.js | 3 +++ react/features/base/config/configType.ts | 1 + react/features/base/config/configWhitelist.ts | 1 + react/features/base/connection/actions.any.ts | 6 +++++- 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/config.js b/config.js index 92877b9558..fcd0b6405d 100644 --- a/config.js +++ b/config.js @@ -51,6 +51,9 @@ var config = { // Websocket URL (XMPP) // websocket: 'wss://jitsi-meet.example.com/' + subdir + 'xmpp-websocket', + // Whether BOSH should be preferred over WebSocket if both are configured. + // preferBosh: false, + // The real JID of focus participant - can be overridden here // Do not change username - FIXME: Make focus username configurable // https://github.com/jitsi/jitsi-meet/issues/7376 diff --git a/react/features/base/config/configType.ts b/react/features/base/config/configType.ts index 5050fd2ff7..f0b61b9c88 100644 --- a/react/features/base/config/configType.ts +++ b/react/features/base/config/configType.ts @@ -520,6 +520,7 @@ export interface IConfig { pcStatsInterval?: number; peopleSearchQueryTypes?: string[]; peopleSearchUrl?: string; + preferBosh?: boolean; preferredTranscribeLanguage?: string; prejoinConfig?: { enabled?: boolean; diff --git a/react/features/base/config/configWhitelist.ts b/react/features/base/config/configWhitelist.ts index 1572f70478..be482ea0b1 100644 --- a/react/features/base/config/configWhitelist.ts +++ b/react/features/base/config/configWhitelist.ts @@ -197,6 +197,7 @@ export default [ 'participantMenuButtonsWithNotifyClick', 'participantsPane', 'pcStatsInterval', + 'preferBosh', 'prejoinConfig', 'prejoinPageEnabled', 'recordingService', diff --git a/react/features/base/connection/actions.any.ts b/react/features/base/connection/actions.any.ts index 49bbc9c9c8..0e0fb41270 100644 --- a/react/features/base/connection/actions.any.ts +++ b/react/features/base/connection/actions.any.ts @@ -120,7 +120,7 @@ export function constructOptions(state: IReduxState) { options.iceServersOverride = iceServersOverride; } - const { bosh } = options; + const { bosh, preferBosh } = options; let { websocket } = options; // TESTING: Only enable WebSocket for some percentage of users. @@ -130,6 +130,10 @@ export function constructOptions(state: IReduxState) { } } + if (preferBosh) { + websocket = undefined; + } + // WebSocket is preferred over BOSH. const serviceUrl = websocket || bosh;