• 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.

    1. const http2 = require('http2');
    2. const client = http2.connect('https://example.org');
    3. client.on('altsvc', (alt, origin, streamId) => {
    4. console.log(alt);
    5. console.log(origin);
    6. console.log(streamId);
    7. });