diff options
author | Maxim Devaev <[email protected]> | 2024-12-26 05:05:03 +0200 |
---|---|---|
committer | Maxim Devaev <[email protected]> | 2024-12-26 05:05:03 +0200 |
commit | 287244d37682232cca23efed55dfe7e1ba74b5fd (patch) | |
tree | 1f6cf99b6ab0c69a4261640c1b42fb5f6811823a | |
parent | 56438a372e4341f60b856663e3b0629ec3e4ff88 (diff) |
kvmd: disabled legacy API by default
-rw-r--r-- | kvmd/apps/kvmd/server.py | 2 | ||||
-rw-r--r-- | web/share/js/kvm/session.js | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/kvmd/apps/kvmd/server.py b/kvmd/apps/kvmd/server.py index 8e1f4adc..4f323aed 100644 --- a/kvmd/apps/kvmd/server.py +++ b/kvmd/apps/kvmd/server.py @@ -234,7 +234,7 @@ class KvmdServer(HttpServer): # pylint: disable=too-many-arguments,too-many-ins @exposed_http("GET", "/ws") async def __ws_handler(self, req: Request) -> WebSocketResponse: stream = valid_bool(req.query.get("stream", True)) - legacy = valid_bool(req.query.get("legacy", True)) + legacy = valid_bool(req.query.get("legacy", False)) async with self._ws_session(req, stream=stream, legacy=legacy) as ws: (major, minor) = __version__.split(".") await ws.send_event("loop", { diff --git a/web/share/js/kvm/session.js b/web/share/js/kvm/session.js index c2f13342..c9839aca 100644 --- a/web/share/js/kvm/session.js +++ b/web/share/js/kvm/session.js @@ -293,7 +293,7 @@ export function Session() { tools.httpGet("/api/auth/check", null, function(http) { if (http.status === 200) { - __ws = new WebSocket(`${tools.is_https ? "wss" : "ws"}://${location.host}/api/ws?legacy=0`); + __ws = new WebSocket(`${tools.is_https ? "wss" : "ws"}://${location.host}/api/ws`); __ws.sendHidEvent = (event) => __sendHidEvent(__ws, event.event_type, event.event); __ws.onopen = __wsOpenHandler; __ws.onmessage = __wsMessageHandler; |