Handle a WebSocket
Convert a flow of messages to a flow of frame events.
Convert a flow of messages to a flow of frame events.
This implements the WebSocket control logic, including handling ping frames and closing the connection in a spec compliant manner.