事件:'push'


¥Event: 'push'

当接收到服务器推送流的响应头时,则会触发 '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);
});