update the chatbox
  setInterval(updateChatbox, 5000);

  // Listen for messages from the server
  ws.onmessage = (event) => {
    const receivedMessage = event.data;
    displayMessage(receivedMessage, "server");
  };
</script>
</body>
</html>