1'use strict'; 2 3const common = require('../common'); 4if (!common.hasCrypto) 5 common.skip('missing crypto'); 6const http2 = require('http2'); 7const fixtures = require('../common/fixtures'); 8 9const fname = fixtures.path('elipses.txt'); 10 11const server = http2.createServer(common.mustCall((request, response) => { 12 response.stream.respondWithFile(fname); 13})); 14server.listen(0, () => { 15 const client = http2.connect(`http://localhost:${server.address().port}`); 16 const req = client.request(); 17 req.on('response', common.mustCall()); 18 req.on('end', common.mustCall(() => { 19 client.close(); 20 server.close(); 21 })); 22 req.end(); 23 req.resume(); 24}); 25