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

RFC 6455 by default? #1679

Closed
basickarl opened this issue Jan 16, 2020 · 6 comments · Fixed by #1681
Closed

RFC 6455 by default? #1679

basickarl opened this issue Jan 16, 2020 · 6 comments · Fixed by #1681

Comments

@basickarl
Copy link

Is this module by default RFC 6455 compliant? Or must we do for example the utf-8 and safe buffer checking manually?

I was reading this section: https://github.com/websockets/ws#opt-in-for-performance-and-spec-compliance

So I'm guessing manual checking those two things. But are there any other things in the RFC 6455 yous are aware of that ws doesn't do out-of-the-box (that's if ws isn't RFC 6455 compliant ws out-of-the-box)?

@lpinca
Copy link
Member

lpinca commented Jan 17, 2020

But are there any other things in the RFC 6455 yous are aware of that ws doesn't do out-of-the-box

Apart from UTF-8 validation (which can be made spec compliant via utf-8-validate) the only thing I can think of is that the server for historical reasons also accepts non masked frames whilst the spec specify that

The server MUST close the connection upon receiving a frame that is not masked.

in https://tools.ietf.org/html/rfc6455#section-5.1

lpinca added a commit that referenced this issue Jan 19, 2020
Follow the specification and close the connection when a non masked
frame is received on the server or a masked frame is received on the
client.

Refs: https://tools.ietf.org/html/rfc6455#section-5.1

Closes #1679
lpinca added a commit that referenced this issue Jan 19, 2020
Follow the specification and close the connection when a non masked
frame is received on the server or a masked frame is received on the
client.

Refs: https://tools.ietf.org/html/rfc6455#section-5.1

Closes #1679
lpinca added a commit that referenced this issue Jan 21, 2020
Follow the specification and close the connection when a non masked
frame is received on the server or a masked frame is received on the
client.

Refs: https://tools.ietf.org/html/rfc6455#section-5.1

Closes #1679
@basickarl
Copy link
Author

@lpinca Thanks for the answer and fix, cheers!

@tcf909
Copy link

tcf909 commented Apr 25, 2020

This was certainly a breaking change. A semver minor increment would have been appreciated here.

Also, what about the ability to continue not masking connections when mask is explicitly set to false?

@lpinca
Copy link
Member

lpinca commented Apr 26, 2020

In a certain way, every bug fix is a breaking change.

Also, what about the ability to continue not masking connections when mask is explicitly set to false?

You can still do that but the receiving end, if spec compliant, will close the connection if the frame needs to be masked.

@angaaron
Copy link

angaaron commented Nov 17, 2020

@lpinca Is there a way to disable the mask check on the client receiving the messages?

@lpinca
Copy link
Member

lpinca commented Nov 17, 2020

@angaaron no.

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

Successfully merging a pull request may close this issue.

4 participants