• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict';
2
3const common = require('../common');
4if (!common.hasCrypto)
5  common.skip('missing crypto');
6const assert = require('assert');
7const http2 = require('http2');
8const net = require('net');
9
10// Verifies that port 80 gets set as expected
11
12const connect = net.connect;
13net.connect = common.mustCall((...args) => {
14  assert.strictEqual(args[0].port, '80');
15  return connect(...args);
16});
17
18const client = http2.connect('http://localhost:80');
19
20// A socket error may or may not occur depending on whether there is something
21// currently listening on port 80. Keep this as a non-op and not a mustCall or
22// mustNotCall.
23client.on('error', () => {});
24
25client.close();
26