req.protocol

req.protocol

Contains the request protocol string: either http or (for TLS requests) https.

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

1
2
req.protocol
// => "http"
doc_Express
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.