From 484cc2990bef6c4d6912d4283441ac34f21948b5 Mon Sep 17 00:00:00 2001 From: Animadei <10407105+Animadei@users.noreply.github.com> Date: Thu, 29 Mar 2018 00:36:19 -0700 Subject: [PATCH] Added support for switching between secure and non-secure WebSocket mode. --- client/jsmpg-vnc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/jsmpg-vnc.js b/client/jsmpg-vnc.js index d0bdc80..e07b59d 100644 --- a/client/jsmpg-vnc.js +++ b/client/jsmpg-vnc.js @@ -3,7 +3,7 @@ document.body.className = ('ontouchstart' in window) ? 'mobile' : 'desktop'; // Setup the WebSocket connection and start the player -var client = new WebSocket( 'ws://' + window.location.host + '/ws' ); +var client = new WebSocket(((window.location.protocol === 'https:') ? 'wss://' : 'ws://') + window.location.host + '/ws' ); var canvas = document.getElementById('videoCanvas'); var player = new jsmpeg(client, {canvas:canvas});