-
-
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
"Invalid WebSocket frame: RSV1 must be clear" Error on WS 8.8 #2058
Comments
Set them at the process level. For example
|
We tried again with #2019 but problem not solved. our API's always failed after upgrading 8.8.0. But I can ask another question, we can't use websocket library in browser. So we have to use JS Websocket , is there any problem about that also ? |
Accidentally close so sorry about that. |
No, that is ok. About your problem, write and share a minimal reproducible test case using only |
You can send the invalid frame like this: const WebSocket = require('ws');
const server = new WebSocket.Server({ port: 0 }, function () {
const ws = new WebSocket(`ws://localhost:${server.address().port}`);
ws.on('open', function () {
ws._socket.write(Buffer.from('c200', 'hex'));
});
});
server.on('connection', function (ws) {
ws.on('error', console.error);
}); |
Actually we don't send a message at the startup, We only connect socket and API's are crashed with this error. I will prepare a nodejs code for reproducing. Thank you for your support |
It doesn't matter when the invalid frame is sent. It can happen at any time. Make sure that the listener of the |
We found smt but we didn't understand how to reproduce it. In Windows machine code works, but in the docker containerized linux nodejs(node 16) machine not working. Always return 1002 code number while connecting WSS. |
I think there is something wrong in your setup but anyway, the server should not crash if there is a listener for the |
Ok. Thank you very much Ipinca we will investigate into this issue. I'll inform you our solution. |
Hey Ipinca, I finally found the problem. Like as you said your code works as expected, but our security guys try smt in the firewall ip intervention rules added. All WS connection requests are distorted. There is no problem right now. Thank you for your support |
Is there an existing issue for this?
Description
Before the previous version WS, we have no issue. But after upgrading ws 8.8 we encounter this error.
"Invalid WebSocket frame: RSV1 must be clear".
While Client side is requesting connection, API's are down and restarted.
Do you have any suggestion about this topic?
PS: I check your changes, you change only environment variables on bufferutil and utf8, how we can use these environment variables?
ws version
8.8.0
Node.js Version
16.15.1
System
Expected result
Connection should be successful and not crashed APIs.
Actual result
"Invalid WebSocket frame: RSV1 must be clear".
Attachments
No response
The text was updated successfully, but these errors were encountered: