openvidu-server dashboard autodiscovery websocket URL

pull/20/head
pabloFuente 2017-06-14 15:46:07 +02:00
parent 83edc43299
commit 125d52e3a5
1 changed files with 5 additions and 1 deletions

View File

@ -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');