Files
zeekay 241625e7d9 rename: ziti → zt across all paths
- Repo names: ziti-* → zt-*
- Go modules: github.com/hanzozt/ziti → github.com/hanzozt/zt
- Docker images: hanzozt/ziti-* → hanzozt/zt-*
- C/Java/JS symbols: ziti_* → zt_*
- File and directory names updated
2026-02-18 18:34:19 -08:00

26 lines
575 B
JavaScript

var webSocket;
function openWebSocket() {
if (webSocket !== undefined && webSocket.readyState !== WebSocket.CLOSED) {
return;
}
webSocket = new WebSocket("ws://localhost:8080/metrics");
webSocket.onmessage = function (event) {
let msg = $.parseJSON(event.data);
processMessage(msg);
};
webSocket.onclose = function (event) {
console.log("connection closed");
};
}
$(window).on('beforeunload', function(){
webSocket.close();
console.log("closed websocket");
});
(function () {
openWebSocket();
})();