req.hostname

req.hostname

Contains the hostname derived from the Host HTTP header.

When the trust proxy setting does not evaluate to false, this property will instead have the value of the X-Forwarded-Host header field. This header can be set by the client or by the proxy.

// Host: "example.com:3000"
req.hostname
// => "example.com"
doc_Express
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.