totaljs / framework

Node.js framework
http://www.totaljs.com
Other
4.36k stars 450 forks source link

How can I get websocket close code and msg? #653

Closed ckpiggy closed 6 years ago

ckpiggy commented 6 years ago

When the server close websocket connection, we can send code and message. https://docs.totaljs.com/latest/en.html#api~WebSocketClient~client.close

But it seems I can't get the code and message on "close" event, as I am a client. https://docs.totaljs.com/latest/en.html#api~WebSocketClient~client.on('close')

petersirka commented 6 years ago

Hi @ckpiggy, there is not a support for it, but I'm going to look into it.

petersirka commented 6 years ago

Hi @ckpiggy I have fixed it. Just download latest beta version $ npm install total.js@beta

petersirka commented 6 years ago

Documentation: https://docs.totaljs.com/v3.x.x/en.html#api~WebSocketClient~client.on('close')