-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
RangeError: Invalid WebSocket frame: RSV2 and RSV3 must be clear #290
Comments
For more information, see websockets/ws#1354 Closes #290
Thanks for the report! I found an issue from the The fix should be just 3 lines of code. I'll publish it in the next few days, probably just after the weekend. |
@jonasgloning thank you very much, looking forward for the next release. |
I don't think is completed @tahayk - commits which updated some codestyling were created referencing this ticket and closed. There wasn't anything relating to this ticket yet... I'm also eagerly awaiting it :) |
@intellix is right. I tried to create that commit on mobile - but the change didn't get saved, and the commit was mostly empty. I'll try again once I have access to a computer again. |
# [1.0.0-rc.3](v1.0.0-rc.2...v1.0.0-rc.3) (2022-11-10) ### Bug Fixes * the server could crash if a client sends invalid frames ([33e6d75](33e6d75)), closes [#290](#290)
This comment was marked as outdated.
This comment was marked as outdated.
Hey @tahayk, I found a way to to reproduce your error message: const WebSocket = require('ws');
const ws = new WebSocket('ws://localhost:9000/peerjs?key=peerjs&id=peerjs&key=peerjs');
ws.on('open', () => ws._socket.write(Buffer.from([0x10]))); But the server doesn’t crash. Even very old versions are fine. Can you tell me a bit more about your environment? I’m afraid without reproducing the crash; we can’t fix it. |
Hi @jonasgloning , maybe this helps. I'm able to reproduce the error with the following. SERVER:
CLIENT:
The server then crushes with the following: RangeError: Invalid WebSocket frame: RSV2 and RSV3 must be clear |
Hey @jonasgloning, I couldn't reproduce the error with your code, |
I could reproduce the crash with the code from @RoundDiceChamp, thanks! New beta is on npm: https://github.com/peers/peerjs-server/releases/tag/v1.0.0-rc.4 |
Thank you very much @jonasgloning
but this time I'm able to catch it using the following code: (it wasn't possible before): const app = express();
const server = app.listen(PORT, HOST, () => {
console.log(`App listening on http://${HOST}:${PORT}`);
});
const peerServer = ExpressPeerServer(server, {
debug: true,
path: '/',
proxied: true,
allow_discovery: false
});
const peerError = (error) => {
console.error('Error type:');
console.error(error.type);
console.error('Error message:');
console.error(error);
}
peerServer.on('error', peerError); |
🎉 This issue has been resolved in version 1.0.0-rc.5 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This issue has been resolved in version 1.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
# [1.1.0-rc.1](v1.0.0...v1.1.0-rc.1) (2024-04-01) ### Bug Fixes * **deps:** update dependency @types/express to v4.17.18 ([f4bcc16](f4bcc16)) * **deps:** update dependency @types/express to v4.17.19 ([ebec5b0](ebec5b0)) * **deps:** update dependency @types/express to v4.17.20 ([a6c01fd](a6c01fd)) * **deps:** update dependency @types/express to v4.17.21 ([80df87f](80df87f)) * **deps:** update dependency express to v4.18.3 ([ff0b83a](ff0b83a)) * **deps:** update dependency express to v4.19.0 ([208f108](208f108)) * **deps:** update dependency express to v4.19.1 ([3a67b5d](3a67b5d)) * **deps:** update dependency express to v4.19.2 ([ec993f6](ec993f6)) * **deps:** update dependency node-fetch to v3.3.1 ([2275ce3](2275ce3)) * **deps:** update dependency node-fetch to v3.3.2 ([05a1833](05a1833)) * **deps:** update dependency yargs to v17.7.2 ([23b4e47](23b4e47)) * empty npm package ([f4c359a](f4c359a)), closes [#318](#318) * force new version ([26877ca](26877ca)) * import from ESM only environments ([993dee9](993dee9)) * reduce unnecessary timeouts ([638af56](638af56)), closes [#431](#431) * remove confusing version number ([f6314df](f6314df)) * the server could crash if a client sends invalid frames ([33e6d75](33e6d75)), closes [#290](#290) ### Features * build Docker image for `arm64` ([a61f103](a61f103)) ### Reverts * Revert "build: deploy to fly.io" ([c3de627](c3de627)) * Revert "chore: Configure Mend Bolt for GitHub (#349)" ([fd00aef](fd00aef)), closes [#349](#349)
🎉 This issue has been resolved in version 1.1.0-rc.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
I have been using PeerJS server for a couple of months, and sometimes I notice that the server crashes because of this error:
Unfortunately I couldn't find a way to reproduce it, any idea how to handle it or fix it ?
Thank you in advance.
The text was updated successfully, but these errors were encountered: