Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

feat(config.js): add 'websocket' config option

paweldomasb25db3ce2e6e
diff --git a/config.js b/config.js
index 073b34b3ff..8ae74ec128 100644
--- a/config.js
+++ b/config.js
@@ -30,6 +30,9 @@ var config = {
// BOSH URL. FIXME: use XEP-0156 to discover it.
bosh: '//jitsi-meet.example.com/http-bind',
+ // Websocket URL
+ // websocket: 'wss://jitsi-meet.example.com/xmpp-websocket',
+
// The name of client node advertised in XEP-0115 'c' stanza
clientNode: 'http://jitsi.org/jitsimeet',
diff --git a/connection.js b/connection.js
index fe725239de..12a1beda6d 100644
--- a/connection.js
+++ b/connection.js
@@ -75,7 +75,15 @@ function connect(id, password, roomName) {
const connectionConfig = Object.assign({}, config);
const { issuer, jwt } = APP.store.getState()['features/base/jwt'];
- connectionConfig.bosh += `?room=${roomName}`;
+ // Use Websocket URL for the web app if configured. Note that there is no 'isWeb' check, because there's assumption
+ // that this code executes only on web browsers/electron. This needs to be changed when mobile and web are unified.
+ let serviceUrl = connectionConfig.websocket || connectionConfig.bosh;
+
+ serviceUrl += `?room=${roomName}`;
+
+ // FIXME Remove deprecated 'bosh' option assignment at some point(LJM will be accepting only 'serviceUrl' option
+ // in future). It's included for the time being for Jitsi Meet and lib-jitsi-meet versions interoperability.
+ connectionConfig.serviceUrl = connectionConfig.bosh = serviceUrl;
const connection
= new JitsiMeetJS.JitsiConnection(
diff --git a/react/features/base/connection/actions.native.js b/react/features/base/connection/actions.native.js
index 5bf8441c8a..2e474a8fc9 100644
--- a/react/features/base/connection/actions.native.js
+++ b/react/features/base/connection/actions.native.js
@@ -312,7 +312,8 @@ function _constructOptions(state) {
room && (bosh += `?room=${getBackendSafeRoomName(room)}`);
- options.bosh = bosh;
+ // FIXME Remove deprecated 'bosh' option assignment at some point.
+ options.serviceUrl = options.bosh = bosh;
}
return options;