mirror of
https://github.com/hack-chat/main.git
synced 2024-03-22 13:20:33 +08:00
Merge pull request #54 from paulgreg/master
Use wss if page is hosted on https
This commit is contained in:
commit
651a141b3f
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user