Hey! Yeah, `req.headers.host` is a good start, but it’s not always reliable, especially with proxies.
For the nodejs request source hostname, you might wanna check `req.headers['x-forwarded-host']` if you're behind a load balancer.
Also, the `host` header can be spoofed, so if security’s a concern, look into validating it.
Here’s a quick snippet:
```javascript
const host = req.headers['x-forwarded-host'] || req.headers.host;
console.log('Host:', host);
```
Hope that helps!
For the nodejs request source hostname, you might wanna check `req.headers['x-forwarded-host']` if you're behind a load balancer.
Also, the `host` header can be spoofed, so if security’s a concern, look into validating it.
Here’s a quick snippet:
```javascript
const host = req.headers['x-forwarded-host'] || req.headers.host;
console.log('Host:', host);
```
Hope that helps!
