Pārlūkot izejas kodu

#875 fix grabbing client ip from sio environ

Rodja Trappe 2 gadi atpakaļ
vecāks
revīzija
124930acf5
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      nicegui/client.py

+ 1 - 1
nicegui/client.py

@@ -53,7 +53,7 @@ class Client:
     @property
     def ip(self) -> Optional[str]:
         """Return the IP address of the client, or None if the client is not connected."""
-        return self.environ.get('REMOTE_ADDR') if self.environ else None
+        return self.environ['asgi.scope']['client'][0] if self.environ else None
 
     @property
     def has_socket_connection(self) -> bool: