Hi!
I need to get the IP host address of the remote client to complete some information in an audit log.
I have already developed something similar in Outsystems 11 using the system dependency HTTPRequestHandler / GetIp.
I have searched online and in this forum and found a similar question by Jeff Barsness but I still miss the reference to the request elements.
The ODC HTTP library offers these "get" methods but none of them seems useful to get the IP host address of the remote client.
Any ideas? Thanks in advance for your attention and support!
Marco
Hi Marco,
you can try to use the Request_GetHeaders action and query the X-Forwarded-For header.
Stefan
Hi @Marco Del Dottore ,
1. Use Request Headers (X-Forwarded-For)
(or)
2. Use an External API (Fallback Option)
If you cannot obtain the IP directly, you could use an external IP detection service like:
* https://api64.ipify.org/?format=json
* https://checkip.amazonaws.com/
You can call these services via an HTTP request to fetch the client’s public IP.
Hope this helps,
Thanks,
Dhanasingh Dennison.
Thanks a lot Stefan and Dhanasingh for your prompt reply and your kind help.
I will try to query for X-Forwarded-For as suggested.
Have a nice day!
I have a similar use-case for this too. Would you be so nice to update whether Request Headers (X-Forwarded-For) works for this?
Thank you!
Hi Jun Mun.
Yes, I tried to fetch the "X-Forwarded-For" header and the function returns the correct IP.
Thanks again to Stefan and Dhanasingh