-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Server crashes with Invalid WebSocket frame #1825
Comments
This is expected. Add a listener for the |
FYI, it's not the sever that emits the error but the server client (the |
@lpinca Thanks for having a look. Some context: The problem was indeed in our application code. The event listeners — including the one for "error" — got removed as part of closing the I solved it by cleaning up listeners only on "close" event. If the |
@lpinca Is it necessary to remove this event listener via |
It is ok to keep it attached. |
@lpinca Relatedly, do I need to ensure that the I looked through the README but couldnt find any documentation about the 'error' event. |
It is documented here: https://github.com/websockets/ws/blob/8.8.1/doc/ws.md#event-error-1. |
Duplicate of closed issue: #1777
Description
The server crashes on an invalid WS frame. I have the impression this is not intended behaviour. I've been reading the code at
Receiver.controlMessage
andReceiver.receiverOnError
but can't seem to find a reason for it to throw an Error besides emitting it. If I would know how to catch this error I could work around the problem.Reproducible in:
Steps to reproduce:
Send a 1006 frame to the server
Expected result:
Server emits error
Actual result:
Error thrown and app crashes
Attachments:
The text was updated successfully, but these errors were encountered: