Commit a40b1c75 authored by Nathan Bean's avatar Nathan Bean

Automatically pick websocket protocol

parent 829f49c8
......@@ -13,7 +13,8 @@ body.append('div')
.attr('id', 'visualizations');
// Create the websocket
const socket = new WebSocket(`ws://${window.location.host}`);
const protocol = (window.location.protocol === "https") ? "wss" : "ws";
const socket = new WebSocket(`${protocol}://${window.location.host}`);
// Connection opened
socket.addEventListener('open', function (event) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment