Fix WebSocket connection.

This commit is contained in:
emil28092005
2026-01-16 20:31:39 +03:00
parent acede2104a
commit c7955ecee7
2 changed files with 3 additions and 5 deletions
-2
View File
@@ -1,5 +1,3 @@
version: '3.8'
services: services:
jenkins: jenkins:
image: jenkins/jenkins:lts-jdk17 image: jenkins/jenkins:lts-jdk17
+3 -3
View File
@@ -23,12 +23,12 @@ function loadRooms() {
function connectRoom() { function connectRoom() {
const room = roomSelect.value || 'general'; const room = roomSelect.value || 'general';
const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:'; const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
const host = window.location.host;
if (ws) { if (ws) {
ws.close(); ws.close();
} }
const wsUrl = `${protocol}//${host}/ws/${room}`;
ws = new WebSocket(`${protocol}//localhost:8080/ws/${room}`); ws = new WebSocket(wsUrl);