wss support

This commit is contained in:
Piyush मिश्रः 2021-05-06 23:38:44 +05:30
parent f5bfea5b3e
commit 9da8d1ccd0
2 changed files with 8 additions and 2 deletions

View File

@ -18,7 +18,7 @@
text-align: center;
">
<img src="img/loading.svg" style="height: 100%;">
<button class="button" onclick="leave()">Close</button>
<button id="progress_button" class="button is-hidden" onclick="leave()">Close</button>
</div>
</div>
<!-- Connect Screen -->

View File

@ -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('&');