Recording layout: better way of getting WS protocol

pull/771/head
pabloFuente 2022-12-13 13:26:03 +01:00
parent ca1dd07f08
commit c924cb9ab5
1 changed files with 2 additions and 1 deletions

View File

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