nvalid JSON: ${e.message}`);
            }
        }

        function sendOspreyTest() {
            sendMessage('Osprey WebSocket Runtime Test - Hello from Browser!');
        }

        function sendChatMessage() {
            const chatMsg = {
                type: 'chat',
                user: 'BrowserClient',
                message: 'Hello from the browser WebSocket client!',
                timestamp: new Date().toISOString()
            };
            sendMessage(JSON.stringify(chatMsg), true);
   