You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
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
All reactions