aboutsummaryrefslogtreecommitdiffstats
path: root/res/client.js
diff options
context:
space:
mode:
authorRblSb <msrblsb@gmail.com>2020-03-08 09:43:48 +0300
committerRblSb <msrblsb@gmail.com>2020-03-08 09:43:48 +0300
commit39e12465aa30c79799e9c443f0fa393a07019cef (patch)
tree678ab49f5766ed24d1211b0aa9394f4291fbffd4 /res/client.js
parenta156726fd7962dd51886b8ecfb0cfd54ef2343ae (diff)
Use wss protocol on https page
Diffstat (limited to 'res/client.js')
-rw-r--r--res/client.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/res/client.js b/res/client.js
index 240d382..932f180 100644
--- a/res/client.js
+++ b/res/client.js
@@ -806,7 +806,11 @@ client_Main.prototype = {
}
,openWebSocket: function(host,port) {
var _gthis = this;
- this.ws = new WebSocket("ws://" + host + ":" + port);
+ var protocol = "ws:";
+ if(window.location.protocol == "https:") {
+ protocol = "wss:";
+ }
+ this.ws = new WebSocket("" + protocol + "//" + host + ":" + port);
this.ws.onmessage = $bind(this,this.onMessage);
this.ws.onopen = function() {
_gthis.serverMessage(1);
@@ -973,7 +977,7 @@ client_Main.prototype = {
var data = JSON.parse(e.data);
var t = data.type;
var t1 = t.charAt(0).toLowerCase() + HxOverrides.substr(t,1,null);
- haxe_Log.trace("Event: " + data.type,{ fileName : "src/client/Main.hx", lineNumber : 258, className : "client.Main", methodName : "onMessage", customParams : [data[t1]]});
+ haxe_Log.trace("Event: " + data.type,{ fileName : "src/client/Main.hx", lineNumber : 260, className : "client.Main", methodName : "onMessage", customParams : [data[t1]]});
switch(data.type) {
case "AddVideo":
this.player.addVideoItem(data.addVideo.item,data.addVideo.atEnd);
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage