Recording layout: dynamic WS protocol depending on current location.protocol

pull/771/head
pabloFuente 2022-12-13 13:24:39 +01:00
parent ea724a8db0
commit ca1dd07f08
1 changed files with 1 additions and 1 deletions

View File

@ -106,7 +106,7 @@ export class LayoutBaseComponent implements OnInit, OnDestroy {
});
const p = !!this.port ? (':' + this.port) : (!!location.port ? (':' + location.port) : '');
const token = 'wss://' + location.hostname + p + '?sessionId=' + this.sessionId + '&secret=' + this.secret + '&recorder=true';
const token = (location.protocol === 'http' ? 'ws' : 'wss') + '://' + location.hostname + p + '?sessionId=' + this.sessionId + '&secret=' + this.secret + '&recorder=true';
this.session.connect(token)
.catch(error => {
console.error(error);