Back

[SOLVED] Getting IP of user in a function

  • 0
  • Functions
polbuhanky
1 Nov, 2023, 22:32

Can I get IP of user, who execute function? This is necessary for security checks

TL;DR
The user wants to get the IP of the user executing a function. The solution is to check the `req.headers` from the request object.
Drake
1 Nov, 2023, 23:21

try looking at the headers....it might be in there...

polbuhanky
2 Nov, 2023, 08:42

How can i get headers in python function?

polbuhanky
2 Nov, 2023, 10:48
polbuhanky
2 Nov, 2023, 10:49

There isn't any information about ip

Guille
2 Nov, 2023, 11:54

You should check req.headers from your request object

https://appwrite.io/docs/products/functions/development#request

Guille
7 Nov, 2023, 19:43

Hey @polbuhanky can we close this issue?

polbuhanky
7 Nov, 2023, 19:46

Yes, thanks

Guille
7 Nov, 2023, 19:46

[SOLVED] Getting IP of user in a function

Nataly
14 Nov, 2023, 22:59

Hi there! How did you solved it? The only stuff I get in headers is: { "host":"localhost", "x-appwrite-trigger":"http", "x-appwrite-user-id":"654420c...", "x-appwrite-user-jwt":"eyJ0...", "x-appwrite-continent-eu":"false", "content-type":"application/x-www-form-urlencoded", "connection":"keep-alive", "content-length":"296" }

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more