diff --git a/openvidu-server/src/angular/frontend/src/app/app.component.ts b/openvidu-server/src/angular/frontend/src/app/app.component.ts index 2532abe7..4d6b0603 100644 --- a/openvidu-server/src/angular/frontend/src/app/app.component.ts +++ b/openvidu-server/src/angular/frontend/src/app/app.component.ts @@ -15,7 +15,11 @@ export class AppComponent implements OnInit, OnDestroy { constructor(private infoService: InfoService) { } ngOnInit() { - this.websocket = new WebSocket('wss://' + location.hostname + ':8443/info'); + + const protocol = location.protocol.includes('https') ? 'wss://' : 'ws://'; + const port = (location.port) ? (':' + location.port) : ''; + + this.websocket = new WebSocket(protocol + location.hostname + port + '/info'); this.websocket.onopen = (event) => { console.log('Info websocket connected');