You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

19 lines
474 B

'use strict';
const common = require('../common');
const http = require('http');
const net = require('net');
const server = http.createServer(common.mustNotCall());
server.listen(0, common.mustCall(() => {
const req = http.get({
createConnection(options, oncreate) {
const socket = net.createConnection(options, oncreate);
socket.once('close', () => server.close());
return socket;
},
port: server.address().port
});
req.abort();
}));