From 583bc6ea7d6211bd77dc1467d8f492deb7e8234a Mon Sep 17 00:00:00 2001 From: Navaneeth Pk Date: Fri, 5 Nov 2021 19:05:08 +0530 Subject: [PATCH] Switch to secure ws connections when possible (#1380) --- frontend/src/Editor/Editor.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/Editor/Editor.jsx b/frontend/src/Editor/Editor.jsx index 0474eaead7..110dbdfc83 100644 --- a/frontend/src/Editor/Editor.jsx +++ b/frontend/src/Editor/Editor.jsx @@ -116,7 +116,7 @@ class Editor extends React.Component { initWebSocket = () => { // TODO: add retry policy - const socket = new WebSocket(`ws://${this.getWebsocketUrl()}`); + const socket = new WebSocket(`${window.location.protocol === 'https:' ? 'wss' : 'ws'}://${this.getWebsocketUrl()}`); // Connection opened socket.addEventListener('open', function (event) {