应用


🌐 Applications

每个 QuicSession 都与单个应用协议相关联,通过 TLS 握手期间的 ALPN 协商。quic 模块的设计总体上与应用无关,但包含对 HTTP/3 作为特定应用协议的内置支持。当使用 HTTP/3 时,quic 模块提供处理 HTTP/3 特定功能(如头部、尾部和优先级)的额外 API。对于其他应用协议,用户可以在核心 QUIC 传输功能之上实现自己的消息分帧和复用。

🌐 Every QuicSession is associated with a single application protocol, negotiated via ALPN during the TLS handshake. The quic module is designed to be application-agnostic in general but includes built-in support for HTTP/3 as a specific application protocol. When using HTTP/3, the quic module provides additional APIs for handling HTTP/3-specific features such as headers, trailers, and prioritization. For other application protocols, users can implement their own message framing and multiplexing on top of the core QUIC transport features.

在启动 TLS 握手时,客户端将在 ClientHello 中包含支持的 ALPN 协议列表。服务器会选择其中一个协议(如果有)并将其包含在 ServerHello 中。协商的协议决定了 QuicSessionQuicStream API 的行为。例如,当为 HTTP/3 协商 h3 协议时,QuicSessionQuicStream 将支持 HTTP/3 特定的功能。

🌐 When initiating a TLS handshake, the client will include a list of supported ALPN protocols in the ClientHello. The server selects one of these protocols (if any) and includes it in the ServerHello. The negotiated protocol determines how the QuicSession and QuicStream APIs behave. For example, when the h3 protocol is negotiated for HTTP/3, the QuicSession and QuicStream will support HTTP/3-specific features.

目前,quic 模块仅支持 HTTP/3 作为内置应用协议。所有其他协议必须由用户在提供的 JavaScript API 基础上实现。

🌐 Currently, the quic module only supports HTTP/3 as a built-in application protocol. All other protocols must be implemented by the user on top of the provided JavaScript API.