	messageText.textContent = event.data;
			});

			ws.addEventListener("open", (event) => {
				console.log("Client open");
				statusText.textContent = "WebSocket open";
			});

			ws.addEventListener("close", (event) => {
				console.log("Client close");
				statusText.textContent = "WebSocket closed";
			});
		}

		function close() {
			if (!ws) {
				console.log("WebSocket already closed");

				return;
			}

			ws.close();
			ws = undefined;
		}

		function send(message) {
			ws.send(message);
		}
	</sc