Open lionelB opened 8 years ago
I was able to get around this bug by calling close (with code) on the underlying socket: this.socket.socket.close(1000, "Client closed socket");
It would be nice to have the library updated to include this.
same issue
Hello,
I'm having an issue using this lib. when I do
.close()
without any parameter, servers send a frame with no code which is in returned, interpreted by browsers as a 'code:1005' as no code given for closing. And since the code is not1000
, the library try to reconnect.to retrieve a 1000 code, we have to send it as a close reason.
ws.close(1000)
Unfortunatly, the $websocket lib doesn't allow to send a code on close (nor a reason). I can make a PR for the changes, but I don't know if it's better to check 1000 and 1005 code for normal close, since we can't send code, or, if we add other parameters to the close().