aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--client/client.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/client/client.js b/client/client.js
index cf6a2e8..380318e 100644
--- a/client/client.js
+++ b/client/client.js
@@ -73,7 +73,13 @@ 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:'
+ // if you changed the port during the server config, change 'wsPath'
+ // to the new port (example: ':8080')
+ // if you are reverse proxying, change 'wsPath' to the new location
+ // (example: '/chat-ws')
+ var wsPath = ':6060';
+ ws = new WebSocket(protocol + '//' + document.domain + wsPath);
}
var wasConnected = false;