Parse a raw WebSocket payload into a WsFrame.
Accepts a string or anything stringifiable (a Buffer), and returns undefined on malformed JSON so the caller can treat it as a protocol error rather than crashing the socket.
Buffer
undefined
The raw payload.
The parsed frame, or undefined.
Parse a raw WebSocket payload into a WsFrame.
Accepts a string or anything stringifiable (a
Buffer), and returnsundefinedon malformed JSON so the caller can treat it as a protocol error rather than crashing the socket.