事件:'push'


【Event: 'push'

  • headers HTTP/2 头对象
  • flags <number>

'push' 事件在接收到服务器推送流的响应头时触发。监听器回调会传入与这些头相关的 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 and flags associated with the headers.】

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