Merge pull request #49 from bkram/fix/proxy-chat-fix

Fix: fix proxy chat
This commit is contained in:
Marek Farkaš
2024-05-20 19:31:56 +02:00
committed by GitHub
+2 -1
View File
@@ -1,5 +1,6 @@
$(document).ready(function() {
const chatSocket = new WebSocket(`ws://${window.location.host}/chat`);
const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
const chatSocket = new WebSocket(`${protocol}//${window.location.host}${window.location.pathname}chat`);
let chatMessageCount = 0;
const chatMessages = $('#chat-chatbox');
const chatMessagesCount = $('.chat-messages-count');