阿西河

所有教程

公众号
🌙
阿西河前端的公众号

我的收藏

    最近访问  (文章)

      教程列表

      抓包专区
      测试专区

      Node.js ClientHttp2Session altsvc 事件

      Node.js ClientHttp2Session altsvc 事件

      新增于: v9.4.0

      • alt < string>
      • origin < string>
      • streamId < number>

      The ‘altsvc’ event is emitted whenever an ALTSVC frame is received by the client. The event is emitted with the ALTSVC value, origin, and stream ID. If no origin is provided in the ALTSVC frame, origin will be an empty string.

      const http2 = require('http2');
      const client = http2.connect('https://example.org');
      
      client.on('altsvc', (alt, origin, streamId) => {
        console.log(alt);
        console.log(origin);
        console.log(streamId);
      });
      

      更多内容请参考:Node.js HTTP2,或者通过 点击对应菜单 进行查看;


      目录
      本文目录
      目录