核心接口


¥Core API

核心 API 提供了低层的接口,专门围绕支持 HTTP/2 协议功能而设计。它不是专门为与现有的 HTTP/1 模块 API 兼容而设计的。但是,兼容性接口 是。

¥The Core API provides a low-level interface designed specifically around support for HTTP/2 protocol features. It is specifically not designed for compatibility with the existing HTTP/1 module API. However, the Compatibility API is.

http API 相比,http2 核心 API 在客户端和服务器之间更加对称。例如,大多数事件,如 'error''connect''stream',可以由客户端代码或服务器端代码触发。

¥The http2 Core API is much more symmetric between client and server than the http API. For instance, most events, like 'error', 'connect' and 'stream', can be emitted either by client-side code or server-side code.