aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrégory Paul <paulgreg@gmail.com>2019-03-03 22:41:03 +0100
committerGrégory Paul <paulgreg@gmail.com>2019-03-03 22:41:03 +0100
commit75fa07b213f9dc1e974614ae5f1c0cfbdbd35a98 (patch)
tree02685e1a174e6738d74ce3c355538958abf7e6d6
parentUse wss if page is hosted on https (diff)
downloadhackchat-75fa07b213f9dc1e974614ae5f1c0cfbdbd35a98.tar.gz
hackchat-75fa07b213f9dc1e974614ae5f1c0cfbdbd35a98.zip
Introducing wsPath to update path for local installation
-rw-r--r--client/client.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/client/client.js b/client/client.js
index bd3d036..380318e 100644
--- a/client/client.js
+++ b/client/client.js
@@ -74,7 +74,12 @@ function join(channel) {
} else {
// for local installs
var protocol = location.protocol === 'https:' ? 'wss:' : 'ws:'
- ws = new WebSocket(protocol + '//' + document.domain + ':6060');
+ // 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;