From f1f153e0acc5c930b05b2b7091c2dfa86cc66b79 Mon Sep 17 00:00:00 2001 From: Vladyslav Heneraliuk Date: Mon, 16 Dec 2024 20:16:43 +0200 Subject: [PATCH] fixed headers receiving --- deploy/websocket_server/websocket_server.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy/websocket_server/websocket_server.py b/deploy/websocket_server/websocket_server.py index 5a36cd2..d1a6a67 100644 --- a/deploy/websocket_server/websocket_server.py +++ b/deploy/websocket_server/websocket_server.py @@ -113,7 +113,7 @@ def bin_sort(bin): async def alerts_data(websocket, client, shared_data, alert_version): - client_ip = websocket.headers.get("X-Real-IP") + client_ip = websocket.request.headers["X-Real-IP"] while True: if client["firmware"] == "unknown": await asyncio.sleep(0.1) @@ -196,7 +196,7 @@ def send_google_stat(tracker, event): async def echo(websocket, path): nginx_ip, client_port = websocket.remote_address # get real header from websocket - client_ip = websocket.headers.get("X-Real-IP") + client_ip = websocket.request.headers["X-Real-IP"] logger.debug(f"{client_ip}:{client_port} >>> new client") if client_ip in shared_data.blocked_ips: