Skip to content
This repository has been archived by the owner on Mar 8, 2020. It is now read-only.

Commit

Permalink
update support for wss (#122)
Browse files Browse the repository at this point in the history
Signed-off-by: Caroline Church <caroline.church@uk.ibm.com>
  • Loading branch information
cazfletch committed Mar 13, 2018
1 parent 9a10285 commit 7437f8f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
Expand Up @@ -105,7 +105,7 @@ angular.module('bc-manufacturer')
}
console.log(' Connecting to websocket', wsUri);
var webSocketURL = wsUri;
let websocket = new WebSocket(webSocketURL);
var websocket = new WebSocket(webSocketURL);
websocket.onopen = function () {
console.log('Websocket is open');
}
Expand Down
Expand Up @@ -37,8 +37,8 @@ angular.module('bc-vda')
return route === location.path();
}

let destroyed = false;
let websocket;
var destroyed = false;
var websocket;

function openWebSocket() {
var wsUri = '';
Expand Down
Expand Up @@ -84,9 +84,16 @@ angular.module('bc-vda')

// Websockets
var destroyed = false;
let websocket;
var websocket;
function openWebSocket() {
var webSocketURL = 'ws://' + location.host;
var wsUri = '';
if (location.protocol === 'https:') {
wsUri = 'wss://' + location.host;
} else {
wsUri = 'ws://' + location.hostname + ':' + location.port;
}
console.log(' Connecting to websocket', wsUri);
var webSocketURL = wsUri;
websocket = new WebSocket(webSocketURL);

websocket.onopen = function () {
Expand Down

0 comments on commit 7437f8f

Please sign in to comment.