gpt4 book ai didi

http - 解析 "Connection" header 的 http 代理示例?

转载 作者:可可西里 更新时间:2023-11-01 16:37:46 26 4
gpt4 key购买 nike

http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html

HTTP/1.1 proxies MUST parse the Connection header field before a message is forwarded and, for each connection-token in this field, remove any header field(s) from the message with the same name as the connection-token.

有人可以举例说明上一段所指的常见场景吗?

这与 Connection: close header 有什么关系吗?

最佳答案

在 HTTP/1.1 中,一个很好的例子是 Upgrade , 表示客户端希望从 HTTP/1.1 迁移到另一个协议(protocol):

 GET http://www.example.com/hello.txt HTTP/1.1
Connection: upgrade
Upgrade: HTTP/2.0, SHTTP/1.3, IRC/6.9, RTA/x11

如果这是一个代理,则不应将 Upgrade header 传递给任何上游服务器,因为它只对该连接有意义。

Keep-Alive header 也可以出现在 HTTP/1.0 中,但现在已被 HTTP/1.1 淘汰。

关于http - 解析 "Connection" header 的 http 代理示例?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26314702/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com