This repository was archived by the owner on Aug 7, 2023. It is now read-only.
Replies: 2 comments 1 reply
-
|
Duplicate of #282. |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
I gave a solution here #282 (comment) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
For my fastapi application beeing hosted on deta, i want to get the users IP address to implement a feature to avoid the api beeing spammed. After some quick research i found ip_addr = request.client.host, but when hosting on deta it doesnt work.
Code snippet:
@app.get("/api/test")
async def api_check_uuid(request:Request):
client_host = request.client
print(client_host)
return{"hello":"world"}
returns:
Address(host=None, port=0)
When hosting local with uvicorn:
Address(host='127.0.0.1', port=51654)
Does anyone have ideas?
Qwert512
Beta Was this translation helpful? Give feedback.
All reactions