-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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: RSV1 must be clear #1777
Comments
I can't reproduce, what version of wss.on('connection', function connection(ws) {
ws.on('error', console.error);
ws.on('message', function incoming(message) {
console.log('received: %s', message);
});
ws.send('something');
}); |
I tried adding the error handler, it logged the same error. I then tried making a complete example (https://github.com/aantthony/ws-example). Doing a git pull, I restarted my Mac, and now it works. |
Ok, I'm closing then. |
I have a crashing application due to this. It appears to ignore the error handler on the WS instance and simply throws. Is that possible?
|
I've been reading the code at |
seriously guys, our saas went down by this problem. why do you crash the entire app if there is no error handler? why?? sometimes you define a workflow and dont care about errors because those errors are not critical. why do you crash the entire app???? |
@ericrange Can you provide an example code that crashes for 8.x series? BTW in nodejs unhandled error events are thrown by the node libraries internally. Just put a line with .on("error",()=>{}) and move on :) If your case is more complicated do elaborate |
Isn't it a common pattern to simply throw instead of emit in case there is no handler? Thrown errors can be caught after all... The original issue was more around a unexpected throw even when there is an even emitter attached. |
issue.
Description
The example code no longer works. The server will throw
RangeError: Invalid WebSocket frame: RSV1 must be clear
and exit.Reproducible in:
Steps to reproduce:
Expected result:
It should log the message
Actual result:
The text was updated successfully, but these errors were encountered: