Skip to content

Commit 90e83cd

Browse files
oyydleeight
andcommitted
https: test/parallel/test-http2-server-session-destroy.js
Co-Authored-By: leeight <leeight@gmail.com>
1 parent 8e5e01c commit 90e83cd

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test/parallel/test-http2-server-session-destroy.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,15 @@ if (!common.hasCrypto)
66
const h2 = require('http2');
77

88
const server = h2.createServer();
9-
server.listen(0, common.mustCall(() => {
10-
h2.connect(`http://localhost:${server.address().port}`, (session) => {
9+
server.listen(0, common.localhostIPv4, common.mustCall(() => {
10+
const afterConnect = common.mustCall((session) => {
1111
session.request({ ':method': 'POST' }).end(common.mustCall(() => {
1212
session.destroy();
1313
server.close();
1414
}));
1515
});
16+
17+
const port = server.address().port;
18+
const host = common.localhostIPv4;
19+
h2.connect('http://' + host + ':' + port, afterConnect);
1620
}));

0 commit comments

Comments
 (0)