Via 是一个通用首部,是由代理服务器添加的,适用于正向和反向代理,在请求和响应首部中均可出现。这个消息首部可以用来追踪消息转发情况,防止循环请求,以及识别在请求或响应传递链中消息发送者对于协议的支持能力。

Header type General header
Forbidden header name yes

语法

Via: [ <protocol-name> "/" ] <protocol-version> <host> [ ":" <port> ]
or
Via: [ <protocol-name> "/" ] <protocol-version> <pseudonym>

指令

<protocol-name>
可选。所使用的协议名称,如 "HTTP"。
<protocol-version>
所使用的协议版本号, 例如 "1.1"。
<host> and <port>
公共代理的URL及端口号。
<pseudonym>
内部代理的名称或别名。

示例

Via: 1.1 vegur
Via: HTTP/1.1 GWA
Via: 1.0 fred, 1.1 p.example.net

规范

Specification Title
RFC 7230, section 5.7.1: Via Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing

浏览器兼容性

The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic supportChrome Full support YesEdge Full support YesFirefox Full support YesIE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes

Legend

Full support  
Full support

相关内容

文档标签和贡献者

标签: 
此页面的贡献者: WayneCui
最后编辑者: WayneCui,