Fix https in websocket connections

This commit is contained in:
Lucas BEE 2019-05-24 09:52:59 +00:00
parent aaad333ef6
commit a7741ab62b

View File

@ -49,7 +49,7 @@ const WsHandler = (props) => {
stop(); stop();
} }
const type = (location.protocol === "https") ? "wss" : "ws"; const type = (location.protocol === "https:") ? "wss" : "ws";
const socket = new WebSocket(type + ":" + location.host + "/events") const socket = new WebSocket(type + ":" + location.host + "/events")
socket.onopen = () => { socket.onopen = () => {
socket.send(JSON.stringify({ socket.send(JSON.stringify({