Skip to content
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 RSV bits regardless of compression mode #339

Closed
ZackaryWelch opened this issue May 9, 2022 · 4 comments
Closed

Invalid RSV bits regardless of compression mode #339

ZackaryWelch opened this issue May 9, 2022 · 4 comments

Comments

@ZackaryWelch
Copy link

ZackaryWelch commented May 9, 2022

When reading from a websocket client (specifically the python package websocket), I get an error from the websocket connection's read:

failed to read: WebSocket closed: received header with unexpected rsv bits set: true:false:true

This is from an accepted connection with compression disabled. When I set compression to NoContextTakeover, I get the following:

failed to read: WebSocket closed: received header with unexpected rsv bits set: false:false:true

Finally, when compression is set to ContextTakeover:

failed to read: WebSocket closed: sent close frame: status = StatusPolicyViolation and reason = "unexpected data message"

It should be noted the client does not support permessage-deflate. I'm not sure why RSV1 is enabled when compression is disabled, and then disabled when it is enabled. I also do not know why RSV3 is set. The client does not support any RSV bits, and it is clear from source that this library does not support RSV2 or RSV3 at all,l and RSV1 only if compression is enabled.

These bits may also be misread garbage, As I've also seen "false:true:false", which would explain why the settings do not make sense.

@ZackaryWelch
Copy link
Author

Seems related to: #337

@ZackaryWelch ZackaryWelch closed this as not planned Won't fix, can't repro, duplicate, stale May 24, 2022
@nhooyr
Copy link
Contributor

nhooyr commented Mar 7, 2023

@ZackaryWelch Were you able to continue reproducing? #337 seems to have been user error.

@verbumfeit
Copy link

@nhooyr I can reproduce the error with htmx as the client.

received header with unexpected rsv bits set: true:false:false

I would be happy to help debug, but I have no clue yet where to start.

@nhooyr
Copy link
Contributor

nhooyr commented Feb 17, 2024

That's concerning. What version of the library are you using? Is it consistently reproducible?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants