From 1e2a7572a67ef5c8fa12d2ad718bd4b3cabcbdaf Mon Sep 17 00:00:00 2001 From: cdez Date: Thu, 27 Mar 2025 18:35:47 -0700 Subject: [PATCH] Attempt two of fixing the webclient. --- chatserver/templates/index.html | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/chatserver/templates/index.html b/chatserver/templates/index.html index 93f9a5e..5bc5386 100644 --- a/chatserver/templates/index.html +++ b/chatserver/templates/index.html @@ -32,6 +32,14 @@ console.log('Joining chat room:', { username: username, chat_room: chatRoom }); socket.emit('join', { username: username, chat_room: chatRoom }); + socket.on('connect', () => { + console.log('Connected to WebSocket server'); + }); + + socket.on('disconnect', () => { + console.log('Disconnected from WebSocket server'); + }); + // Listen for messages from the server socket.on('message', (data) => { const messageElement = document.createElement('div');