From 125d52e3a5e7faaf429d41373b07afca486c330c Mon Sep 17 00:00:00 2001 From: pabloFuente Date: Wed, 14 Jun 2017 15:46:07 +0200 Subject: [PATCH] openvidu-server dashboard autodiscovery websocket URL --- .../src/angular/frontend/src/app/app.component.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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');