From 9da8d1ccd09a6c714d87ee80e229f3b2753d27ec Mon Sep 17 00:00:00 2001 From: Piyush Mishra Date: Thu, 6 May 2021 23:38:44 +0530 Subject: [PATCH] wss support --- static/index.html | 2 +- static/js/app.js | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/static/index.html b/static/index.html index 32804cb..ffe1182 100644 --- a/static/index.html +++ b/static/index.html @@ -18,7 +18,7 @@ text-align: center; "> - + diff --git a/static/js/app.js b/static/js/app.js index cc838f8..7fd6ac5 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -247,7 +247,11 @@ $(document).ready(() => { }); // Create WebSocket connection. -const socket = new WebSocket('ws://'+window.location.host+'/ws/'); +var wsProtocol = 'ws://'; +if (window.location.protocol === 'https:') { + wsProtocol = 'wss://'; +} +const socket = new WebSocket(wsProtocol+window.location.host+'/ws/'); var myinfo = { kunjika: "", name: "" @@ -258,6 +262,8 @@ var no_name_message = false; // Connection opened socket.addEventListener('open', function (event) { + $('#progress_button').removeClass('is-hidden'); + var params = window.location.search; params = params.substr(1,params.length).split('&');