Via
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 |
浏览器兼容性
BCD tables only load in the browser
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.