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
2016-05-02 16:34:48
Comments
Leave a Comment

Please login to continue.