Fix WebSocket connection.
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
jenkins:
|
||||
image: jenkins/jenkins:lts-jdk17
|
||||
|
||||
+3
-3
@@ -23,12 +23,12 @@ function loadRooms() {
|
||||
function connectRoom() {
|
||||
const room = roomSelect.value || 'general';
|
||||
const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
|
||||
|
||||
const host = window.location.host;
|
||||
if (ws) {
|
||||
ws.close();
|
||||
}
|
||||
|
||||
ws = new WebSocket(`${protocol}//localhost:8080/ws/${room}`);
|
||||
const wsUrl = `${protocol}//${host}/ws/${room}`;
|
||||
ws = new WebSocket(wsUrl);
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user