Use WSS if HTTPS is being used.

This commit is contained in:
Patrick Fairbank
2016-08-28 01:49:30 -07:00
parent 6b8a2680fa
commit a9a38cba66

View File

@@ -5,8 +5,11 @@
var CheesyWebsocket = function(path, events) {
var that = this;
var url = "ws://" + window.location.hostname;
var protocol = "ws://";
if (window.location.protocol == "https:") {
protocol = "wss://";
}
var url = protocol + window.location.hostname;
if (window.location.port != "") {
url += ":" + window.location.port;
}