Merge pull request #93 from papodaca/wss

Use correct websocket protocol
pull/114/head
Akhil Gupta 4 years ago committed by GitHub
commit e17fd545cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -117,8 +117,9 @@
} }
function getWebsocketConnection(onOpen,onMessage){ function getWebsocketConnection(onOpen,onMessage){
const wsProto = window.location.protocol.startsWith('https') ? 'wss://' : 'ws://';
// Create WebSocket connection. // Create WebSocket connection.
const socket = new WebSocket('ws://'+window.location.host+'/ws'); const socket = new WebSocket(wsProto+window.location.host+'/ws');
socket.addEventListener('open', onOpen); socket.addEventListener('open', onOpen);

Loading…
Cancel
Save