事件:'push'


🌐 Event: 'push'

'push' 事件在接收到服务器推送流的响应头时触发。监听器回调会传入 HTTP/2 头对象、与头部相关的标志,以及原始格式的头部(参见 HTTP/2 原始头)。

🌐 The 'push' event is emitted when response headers for a Server Push stream are received. The listener callback is passed the HTTP/2 Headers Object, flags associated with the headers, and the headers in raw format (see HTTP/2 Raw Headers).

stream.on('push', (headers, flags) => {
  console.log(headers);
});