1
0
mirror of https://github.com/KubaPro010/fm-dx-webserver.git synced 2026-02-26 22:13:53 +01:00

Fix: fix proxy chat

This commit is contained in:
Mark de Bruijn
2024-05-15 18:54:37 +02:00
parent 57b276e136
commit de3a33d9a4

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');