• msecs {number}
    • callback {Function}
    1. const http2 = require('http2');
    2. const client = http2.connect('http://example.org:8000');
    3. const { NGHTTP2_CANCEL } = http2.constants;
    4. const req = client.request({ ':path': '/' });
    5. // Cancel the stream if there's no activity after 5 seconds
    6. req.setTimeout(5000, () => req.close(NGHTTP2_CANCEL));