If you're dealing with proxies, the `x-forwarded-for` header is your friend for the nodejs request source hostname.
But heads up—headers can be manipulated, so don’t trust them blindly.
You might wanna use a library like `proxy-addr` to parse it safely:
```javascript
const proxyAddr = require('proxy-addr');
const ip = proxyAddr(req, trustProxy);
```
Check out the docs here: [proxy-addr npm](https://www.npmjs.com/package/proxy-addr).
But heads up—headers can be manipulated, so don’t trust them blindly.
You might wanna use a library like `proxy-addr` to parse it safely:
```javascript
const proxyAddr = require('proxy-addr');
const ip = proxyAddr(req, trustProxy);
```
Check out the docs here: [proxy-addr npm](https://www.npmjs.com/package/proxy-addr).
