Поправки для поддержки reverse-proxy, рефакторинг

This commit is contained in:
Book Pauk
2022-12-04 17:12:24 +07:00
parent 105680e38a
commit 409befce5e
6 changed files with 123 additions and 82 deletions

View File

@@ -1,3 +1,7 @@
import WebSocketConnection from '../../../server/core/WebSocketConnection';
export default new WebSocketConnection();
const protocol = (window.location.protocol == 'https:' ? 'wss:' : 'ws:');
let url = `${protocol}//${window.location.host}${window.location.pathname}`;
url += (url[url.length - 1] === '/' ? 'ws' : '/ws');
export default new WebSocketConnection(url);