Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f4a996fcb9 | ||
|
|
fdbf508bbf | ||
|
|
500fafa5b2 |
@@ -57,7 +57,12 @@ class WebSocketConnection {
|
|||||||
if (this.ws && this.ws.readyState == WebSocket.OPEN) {
|
if (this.ws && this.ws.readyState == WebSocket.OPEN) {
|
||||||
resolve(this.ws);
|
resolve(this.ws);
|
||||||
} else {
|
} else {
|
||||||
url = url || `ws://${window.location.host}/ws`;
|
let protocol = 'ws:';
|
||||||
|
if (window.location.protocol == 'https:') {
|
||||||
|
protocol = 'wss:'
|
||||||
|
}
|
||||||
|
|
||||||
|
url = url || `${protocol}//${window.location.host}/ws`;
|
||||||
|
|
||||||
this.ws = new WebSocket(url);
|
this.ws = new WebSocket(url);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user