Skip to content

Commit

Permalink
https: test/parallel/test-http2-server-session-destroy.js
Browse files Browse the repository at this point in the history
Co-Authored-By: leeight <[email protected]>
  • Loading branch information
oyyd and leeight committed Nov 22, 2018
1 parent 8e5e01c commit 90e83cd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/parallel/test-http2-server-session-destroy.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@ if (!common.hasCrypto)
const h2 = require('http2');

const server = h2.createServer();
server.listen(0, common.mustCall(() => {
h2.connect(`http://localhost:${server.address().port}`, (session) => {
server.listen(0, common.localhostIPv4, common.mustCall(() => {
const afterConnect = common.mustCall((session) => {
session.request({ ':method': 'POST' }).end(common.mustCall(() => {
session.destroy();
server.close();
}));
});

const port = server.address().port;
const host = common.localhostIPv4;
h2.connect('http://' + host + ':' + port, afterConnect);
}));

0 comments on commit 90e83cd

Please sign in to comment.