In the ws Node.js WebSocket library, regarding the event socket.on('close', ...)
, is there any direct way (i. e. by inspecting the event) to determine if the client has closed the socket OR the server closed it for this client?
Even when the server explicitly sets a specific close code (4001), the handler on the server side for the close event gets a generic close code (1005).
So there is no way around but to remember it somewhere if the server closed the socket?