aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--client/client.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/client/client.js b/client/client.js
index cf6a2e8..bd3d036 100644
--- a/client/client.js
+++ b/client/client.js
@@ -73,7 +73,8 @@ function join(channel) {
ws = new WebSocket('wss://hack.chat/chat-ws');
} else {
// for local installs
- ws = new WebSocket('ws://' + document.domain + ':6060');
+ var protocol = location.protocol === 'https:' ? 'wss:' : 'ws:'
+ ws = new WebSocket(protocol + '//' + document.domain + ':6060');
}
var wasConnected = false;