mirror of
https://github.com/hack-chat/main.git
synced 2024-03-22 13:20:33 +08:00
Use wss if page is hosted on https
This commit is contained in:
parent
686f348e87
commit
101f20c084
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user