Get JavaScript document location instead of window and handle proxied url
@@ -340,12 +340,12 @@ class Dashboard {
}
function get_websocket_url(endpoint) {
- var l = window.location;
+ var l = document.location;
return (
(l.protocol === "https:" ? "wss://" : "ws://") +
l.hostname +
(l.port != 80 && l.port != 443 ? ":" + l.port : "") +
- endpoint
+ l.pathname.replace("/statics/individual-cluster-map.html", endpoint)
);
}
