'push' 事件


当接收到服务器推送流的响应头时,则会触发 'push' 事件。 监听器回调传入 HTTP/2 标头对象和与标头关联的标志。

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

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);
});