瀏覽代碼

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: