|
@@ -275,10 +275,11 @@ function _constructOptions(state) {
|
275
|
275
|
// redux store.
|
276
|
276
|
const options = _.cloneDeep(state['features/base/config']);
|
277
|
277
|
|
278
|
|
- // Normalize the BOSH URL.
|
279
|
278
|
let { bosh } = options;
|
|
279
|
+ const { websocket } = options;
|
280
|
280
|
|
281
|
|
- if (bosh) {
|
|
281
|
+ // Normalize the BOSH URL.
|
|
282
|
+ if (bosh && !websocket) {
|
282
|
283
|
const { locationURL } = state['features/base/connection'];
|
283
|
284
|
|
284
|
285
|
if (bosh.startsWith('//')) {
|
|
@@ -295,14 +296,22 @@ function _constructOptions(state) {
|
295
|
296
|
// eslint-disable-next-line max-len
|
296
|
297
|
bosh = `${protocol}//${host}${contextRoot || '/'}${bosh.substr(1)}`;
|
297
|
298
|
}
|
|
299
|
+ }
|
298
|
300
|
|
299
|
|
- // Append room to the URL's search.
|
300
|
|
- const { room } = state['features/base/conference'];
|
|
301
|
+ // WebSocket is preferred over BOSH.
|
|
302
|
+ const serviceUrl = websocket || bosh;
|
301
|
303
|
|
302
|
|
- room && (bosh += `?room=${getBackendSafeRoomName(room)}`);
|
|
304
|
+ // Append room to the URL's search.
|
|
305
|
+ const { room } = state['features/base/conference'];
|
303
|
306
|
|
304
|
|
- // FIXME Remove deprecated 'bosh' option assignment at some point.
|
305
|
|
- options.serviceUrl = options.bosh = bosh;
|
|
307
|
+ if (serviceUrl && room) {
|
|
308
|
+ const roomName = getBackendSafeRoomName(room);
|
|
309
|
+
|
|
310
|
+ options.serviceUrl = `${serviceUrl}?room=${roomName}`;
|
|
311
|
+
|
|
312
|
+ if (options.websocketKeepAliveUrl) {
|
|
313
|
+ options.websocketKeepAliveUrl += `?room=${roomName}`;
|
|
314
|
+ }
|
306
|
315
|
}
|
307
|
316
|
|
308
|
317
|
return options;
|