I have been using Node-RED for 5 years now and have decent exposure to it. We use it for various HTTP calls and use it as a relay from internet to out internal API servers.
We would like to capture the IP address of incoming requests, but once the calls hits Node-RED application, we only see Node-RED server's IP address in our internal API request headers.
I have tried to capture the msg.req.ip and msg.req.connection.remoteAddress as shown in this topic Http in node, caller IP address - #8 by Colin but that always returns 127.0.01 which I think is the local IP address of the Node-RED server as seen by the UI builder.
Can someone help me in capturing and may be forwarding the incoming IP address. Thanks.
My company's IT team manages the Node-RED server backend, I will check with them on Monday but as they use ngnix, its most probably setup as a proxy. I will keep you posted. Thank you for all the help so far.
Be sure to read up on the implications this means for your env. e.g from the docs:
Indicates the app is behind a front-facing proxy, and to use the X-Forwarded-* headers to determine the connection and the IP address of the client. NOTE: X-Forwarded-* headers are easily spoofed and the detected IP addresses are unreliable.