I have a nodejs websocket server and I have the following problem.
When my clients connect to the server and terminate gracefully the onclose method is
onclose
You can check it in the official library documentation. I don't want to copy-paste it here because it can be out of date soon.