Skip to content

Commit

Permalink
fixed headers receiving
Browse files Browse the repository at this point in the history
  • Loading branch information
Foroxon committed Dec 16, 2024
1 parent 27d20cd commit f1f153e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions deploy/websocket_server/websocket_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit f1f153e

Please sign in to comment.