核心接口
【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.】
http2 核心 API 在客户端和服务器端之间比 http 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.】