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

Function runClient

test/sequential/test-tls-psk-client.js:93–120  ·  view source on GitHub ↗
(message, cb)

Source from the content-addressed store, hash-verified

91}));
92
93function runClient(message, cb) {
94 const s = tls.connect(common.PORT, {
95 ciphers: CIPHERS,
96 checkServerIdentity: () => {},
97 pskCallback(hint) {
98 // 'hint' will be null in TLS1.3.
99 if (hint === null || hint === IDENTITY) {
100 return {
101 identity: IDENTITY,
102 psk: Buffer.from(KEY, 'hex'),
103 };
104 }
105 },
106 });
107 s.on('secureConnect', common.mustCall(() => {
108 let data = '';
109 s.on('data', common.mustCallAtLeast((d) => {
110 data += d;
111 }));
112 s.on('end', common.mustCall(() => {
113 cb(null, data);
114 }));
115 s.end(message);
116 }));
117 s.on('error', (e) => {
118 cb(e);
119 });
120}

Callers 1

Calls 4

cbFunction · 0.70
connectMethod · 0.65
onMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…