This commit is contained in:
Asspixel 2022-10-07 22:59:29 -04:00 committed by GitHub
parent 9ff5e6b042
commit 50acfeafda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,33 +0,0 @@
<html>
<head>
<title>query test</title>
<script type="text/javascript">
window.addEventListener("load", () => {
const output = document.getElementById("out");
document.getElementById("testButton").addEventListener("click", () => {
const ws = new WebSocket(document.getElementById("uriField").value);
ws.onopen = (e) => {
output.innerText = "please wait";
ws.send(document.getElementById("acceptField").value);
};
ws.onmessage = (e) => {
try {
output.innerText += JSON.stringify(JSON.parse(e.data), null, 4);
}catch(ee) {
output.innerText += e.data;
}
};
ws.onclose = (e) => {
output.innerText = output.innerText + "\n\nSocket Closed.";
};
});
});
</script>
</head>
<body style="font-family:sans-serif;">
<input type="text" id="uriField" value="ws://127.0.0.1:25565/" /><br />
<input type="text" id="acceptField" value="accept: motd" /><br />
<button id="testButton">send</button>
<pre id="out" style="font-family:sans-serif;"></pre>
</body>
</html>