# req.protocol

包含请求协议字符串:http 或(对于 TLS 请求)https

# 概要

req.protocol

# 描述

包含请求协议字符串:http 或(对于 TLS 请求)https

trust proxy 设置 不计算为 false 时,此属性将使用 X-Forwarded-Proto标头字段的值(如果存在)。此标头可以由客户端或代理设置。

console.dir(req.protocol)
// => "http"
Last Updated: 6/17/2023, 6:57:19 PM