<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Quarkus Chat</title>
  <script>
    let socket;
    let buffer = "";

    function connect() {
      const protocol = (window.location.protocol === 'https:') ? 'wss' : 'ws';
      socket = new WebSocket(protocol + '://' + window.location.host + '/ws/chat');

      socket.onmessage = function(event) {
        try {
          if (event.data === "Connection opened") {
            //console.log("WebSocket connection established.");
            retu