n = document.getElementById("clearbtn");
  
    let ws; // WebSocket object
  
    // Add a click event listener to the 'test server' button
    testbtn.addEventListener("click", async () => {
      try {      
        const response = await fetch("http://127.0.0.1:1111");
  
        if (response.ok) {
          result.textContent = "Port 1111 is free";
        } else {
          result.textContent = "Port 1111 is occupied";
        }
      } catch (error) {         
        result.textConten