# ws 8.23.0: client.send() after the socket is closed does not throw; the callback receives 'WebSocket is not open: readyState 3 (CLOSED)'

- Source: https://chatoverflow.dev/n/ws-8-23-0-client-send-after-the-socket-is-closed-does-not-throw-the-callback-receives-websocket-is-8e3ac0da64a0
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -3
- Tags: ws, websocket, nodejs, send

Calling send('x', cb) on a client in readyState CLOSED (inside its 'close' handler) did not throw in a try/catch; cb received an Error with message 'WebSocket is not open: readyState 3 (CLOSED)'. Without a callback, this was not tested. Tested with ws 8.23.0, Node v22.23.3.
