MCPcopy Index your code
hub / github.com/nodejs/node / mkServer

Function mkServer

test/parallel/test-tls-net-connect-prefer-path.js:22–38  ·  view source on GitHub ↗
(lib, tcp, cb)

Source from the content-addressed store, hash-verified

20}
21
22function mkServer(lib, tcp, cb) {
23 const handler = (socket) => {
24 socket.write(`${libName(lib)}:${
25 server.address().port || server.address()
26 }`);
27 socket.end();
28 };
29 const args = [handler];
30 if (lib === tls) {
31 args.unshift({
32 cert: fixtures.readKey('rsa_cert.crt'),
33 key: fixtures.readKey('rsa_private.pem')
34 });
35 }
36 const server = lib.createServer(...args);
37 server.listen(tcp ? 0 : common.PIPE, common.mustCall(() => cb(server)));
38}
39
40function testLib(lib, cb) {
41 mkServer(lib, true, common.mustCall((tcpServer) => {

Callers 1

testLibFunction · 0.85

Calls 3

unshiftMethod · 0.80
listenMethod · 0.80
cbFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…