Преглед изворни кода

Merge pull request #877 from zauberzeug/client_ip

fix grabbing client ip from sio environ
Falko Schindler пре 2 година
родитељ
комит
a089db38b3
1 измењених фајлова са 1 додато и 1 уклоњено
  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: