Express4中文文档
包含请求协议字符串:http 或(对于 TLS 请求)https。
http
https
当 trust proxy 设置 不计算为 false 时,此属性将使用 X-Forwarded-Proto 标头字段的值(如果存在)。此标头可以由客户端或代理设置。
trust proxy
false
X-Forwarded-Proto
console.dir(req.protocol) // => 'http'