Explorar o código

#875 fix grabbing client ip from sio environ

Rodja Trappe %!s(int64=2) %!d(string=hai) anos
pai
achega
124930acf5
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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: