save latest ws

This commit is contained in:
creeper123123321 2021-01-17 11:05:35 -03:00 committed by GitHub
parent f3987e4ac2
commit 7568e7ec60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,7 +6,13 @@ if (urlParams.get("mcauth_success") == "false") {
alert("Couldn't authenticate with Minecraft.ID: " + urlParams.get("mcauth_msg"));
}
var wsUrl = window.location.host == "viaversion.github.io" ? prompt("VIAaaS instance WS URL") : "wss://" + window.location.host + "/ws";
function askWsUrl() {
let url = prompt("VIAaaS instance websocket", localStorage.getItem("ws-url") || "wss://localhost:25543/ws");
localStorage.setItem("ws-url", url);
return url;
}
var wsUrl = window.location.host == "viaversion.github.io" ? askWsUrl() : "wss://" + window.location.host + "/ws";
var socket = null;
var connectionStatus = document.getElementById("connection_status");