Update run.py
Browse files
run.py
CHANGED
@@ -10,12 +10,13 @@ from google.oauth2 import service_account
|
|
10 |
|
11 |
import socket
|
12 |
|
13 |
-
def get_local_ip():
|
14 |
"""Get the local IP address."""
|
15 |
-
|
16 |
-
local_ip = socket.gethostbyname(
|
17 |
-
|
18 |
-
print(
|
|
|
19 |
return local_ip
|
20 |
val=get_local_ip()
|
21 |
# Google Sheets setup
|
|
|
10 |
|
11 |
import socket
|
12 |
|
13 |
+
def get_local_ip(request: gr.Request):
|
14 |
"""Get the local IP address."""
|
15 |
+
client_ip = request.client.host
|
16 |
+
local_ip = socket.gethostbyname(socket.gethostbyname(""))
|
17 |
+
x_forwarded_for = request.headers.get('x-forwarded-for')
|
18 |
+
print("client_ip", client_ip, text)
|
19 |
+
print("x_forwarded_for", x_forwarded_for)
|
20 |
return local_ip
|
21 |
val=get_local_ip()
|
22 |
# Google Sheets setup
|