1. Introduction (简介)
HTTP extensions (HTTP 扩展, 如 [HTTP] 第 16 节所定义) 有时需要访问底层传输协议功能, 例如不可靠传递 (如 [QUIC-DGRAM] 所提供), 以实现期望的功能。例如, 这可以允许引入不可靠版本的 CONNECT 方法, 并为 WebSockets [WEBSOCKET] 添加不可靠传递。
在第 2 节中, 本文档描述了 HTTP Datagrams (HTTP 数据报), 这是一种在 HTTP 连接内传递双向且可能不可靠的数据报的约定, 在可能的情况下支持多路复用。虽然 HTTP Datagrams 与 HTTP 请求相关联, 但它们不是消息内容的一部分。相反, 它们旨在供 HTTP 扩展 (例如 CONNECT 方法) 使用, 并与所有版本的 HTTP 兼容。
当 HTTP 运行在支持不可靠传递的传输协议上时 (例如当 QUIC DATAGRAM extension [QUIC-DGRAM] 可用于 HTTP/3 [HTTP/3] 时), HTTP Datagrams 可以使用该能力。
在第 3 节中, 本文档描述了 HTTP Capsule Protocol (HTTP 封装协议), 它允许使用可靠传递来传送 HTTP Datagrams。这解决了 HTTP/3 中无法使用或不希望使用 QUIC DATAGRAM frame (QUIC DATAGRAM 帧) 的情况, 或传输协议仅提供可靠传递的情况, 例如在 TCP [TCP] 上运行的 HTTP/1.1 [HTTP/1.1] 或 HTTP/2 [HTTP/2]。
1.1. Conventions and Definitions (约定和定义)
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.
本文档中的关键词 "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", 和 "OPTIONAL" 应按照 BCP 14 [RFC2119] [RFC8174] 中的描述进行解释, 当且仅当它们以全大写形式出现时, 如此处所示。
This document uses terminology from [QUIC].
本文档使用来自 [QUIC] 的术语。
Where this document defines protocol types, the definition format uses the notation from Section 1.3 of [QUIC]. Where fields within types are integers, they are encoded using the variable-length integer encoding from Section 16 of [QUIC]. Integer values do not need to be encoded on the minimum number of bytes necessary.
在本文档定义协议类型的地方, 定义格式使用 [QUIC] 第 1.3 节的表示法。当类型中的字段是整数时, 它们使用 [QUIC] 第 16 节的变长整数编码进行编码。整数值不需要使用最少必要字节数进行编码。
In this document, the term "intermediary" refers to an HTTP intermediary as defined in Section 3.7 of [HTTP].
在本文档中, 术语 "intermediary" (中间件) 指的是 [HTTP] 第 3.7 节中定义的 HTTP intermediary (HTTP 中间件)。