-
-
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
Error: RSV1 must be clear #1140
Comments
This error means that the client is sending a compressed frame but the permessage-deflate extension is disabled. There isn't anything actionable to do apart from handling the error. |
thx |
hey @lpinca got same error when using |
|
Hello. I'm getting the same error if the client connecting is from MacOS/Chrome, but NOT from Windows/Chrome. What can I do on the Server or Client to be able to connect from MacOS? |
I am experiencing the same issue on node v8.11.3 and v10.6.0
Have wrapped ws.send() in a try / catch as well as set |
And how would we handle this particular error? I've read this #1191 (comment). But I already got the following code running in my server and it doesn't seem to be catching this error:
|
@goktugyil wow we were both working on this problem at the same time today. See my comment here: nodejs/node#17806 (comment). It appears that Node v10.14.0 introduced some kind of regression. |
I'm using v10.11.0 in dev environment and v10.10.0 in the server that crashed. Server crashed like 60 times in 2 minutes. And then nothing happened for a day. What do you suggest I do about this? |
@goktugyil no clue. on our end, we were able to isolate it to v10.14.x |
@shellscape |
@goktugyil here is a quick way to reproduce: const { request } = require('http');
const WebSocket = require('ws');
const wss = new WebSocket.Server({ port: 0 }, () => {
const req = request({
port: wss.address().port,
headers: {
Connection: 'Upgrade',
Upgrade: 'websocket',
'Sec-WebSocket-Key': 'dGhlIHNhbXBsZSBub25jZQ==',
'Sec-WebSocket-Version': 13
}
});
req.end(Buffer.from([0xC1, 0x05, 0x5f, 0xeb, 0xe5, 0xf0, 0x1c]));
});
wss.on('connection', (ws) => {
ws.on('error', console.error);
}); |
How does this work without init() first? |
@lpinca would that be a simpler reproduction that should be posted on nodejs/node#24958? |
@shellscape no because what I posted above is done on purpose, the same error was caused by a bug in Node.js core but that is different. The first byte was dropped so the frame was still malformed but not on purpose. Hope it makes sense. |
I couldn't get this to compile at all. |
I am still having this issue in production, can @wyzxxx123 or somebody else reopen it? |
I found I get this serverside when using an espruino esp32 and trying to send a json object directly. The fix is to first turn it into a string |
Hello, @lpinca. We use your library. Generally, everything is OK, but sometimes there are some clients when we got the error |
@n-elloco assuming that permessage-deflate is disabled on the server (it is by default) you can send the following bytes.
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([0xc1, 0x80]));
});
});
server.on('connection', function (ws) {
ws.on('error', console.error);
}); |
The code above produces the following error: I've also ran this one, errors, but no crashes. https://sentry.io/share/issue/5193b3cca33545d8971852049a5e2457/ However when this issue happens to me, 83% of the time it is handled. 17% of the time it is a full server crash. Does the exception stack make any sense to anyone? The socket that connected is using Chrome 99.0.4844.51 Windows 10.0. For my side looks like a normal user It seems when this event happens, it happens multiple times around the same times, makes sense. I get billions of socket connections and events on my site, no problem. Currently using |
i don't even have a line of my code where i can put a try {} catch statement :(
|
Description
Occasional players connecting 10 seconds
Reproducible in:
version:3.0.0
Node.js version(s):v6.10.0
OS version(s):windows server 2008 r2 enterprise
Steps to reproduce:
no way
Expected result:
NO ERROR
Actual result:
Error: RSV1 must be clear
at Receiver.getInfo (D:\HallServer\node_modules\ws\lib\Receiver.js:191:18)
at Receiver.startLoop (D:\HallServer\node_modules\ws\lib\Receiver.js:153:16)
at Receiver.add (D:\HallServer\node_modules\ws\lib\Receiver.js:139:10)
at Socket._ultron.on (D:\HallServer\node_modules\ws\lib\WebSocket.js:142:22)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:176:18)
at Socket.Readable.push (_stream_readable.js:134:10)
at TCP.onread (net.js:548:20)
Attachments:
The text was updated successfully, but these errors were encountered: