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

Function onWebSocketOpen

lib/internal/inspector/network_undici.js:212–224  ·  view source on GitHub ↗
({ websocket, handshakeResponse })

Source from the content-addressed store, hash-verified

210// undici:websocket:open fires when the connection is established, but this results
211// in an inaccurate stack trace.
212function onWebSocketOpen({ websocket, handshakeResponse }) {
213 websocket[kInspectorRequestId] = getNextRequestId();
214 const url = websocket.url.toString();
215 Network.webSocketCreated({
216 requestId: websocket[kInspectorRequestId],
217 url,
218 });
219 Network.webSocketHandshakeResponseReceived({
220 requestId: websocket[kInspectorRequestId],
221 timestamp: getMonotonicTime(),
222 response: handshakeResponse,
223 });
224}
225
226function onWebSocketClose({ websocket }) {
227 if (typeof websocket[kInspectorRequestId] !== 'string') {

Callers

nothing calls this directly

Calls 3

getNextRequestIdFunction · 0.85
getMonotonicTimeFunction · 0.85
toStringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…