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

Why is a close code of 1012 considered a protocol error? #374

Closed
p0fi opened this issue Aug 29, 2017 · 3 comments
Closed

Why is a close code of 1012 considered a protocol error? #374

p0fi opened this issue Aug 29, 2017 · 3 comments

Comments

@p0fi
Copy link

p0fi commented Aug 29, 2017

Hi,

im wondering why the following lines

if closeCode < 1000 || (closeCode > 1003 && closeCode < 1007) || (closeCode > 1011 && closeCode < 3000) {
closeCode = CloseCode.protocolError.rawValue
}

assume that a close code of 1012 is a protocol error?

The code seems to be added as an extension of RFC 6455 here: https://www.ietf.org/mail-archive/web/hybi/current/msg09670.html

The web API description by mozilla (link) also lists 1012 as a valid close code with the meaning

Service Restart - The server is terminating the connection because it is restarting.

@acmacalister
Copy link
Collaborator

Yeah, those opcode aren't apart of the 6455 RFC spec, but you are correct that they appears to have been added to the official IANA registry. Starscream was designed against the original 6455 RFC spec, so that is why we made an assumption those were protocol errors. They were updated in the autobahn test suite (see crossbario/autobahn-testsuite#52 for more info), so we will go ahead and update them accordingly in Starscream. Thanks for the report.

@daltoniam
Copy link
Owner

Version 3.0.0 has been released with a fix for this!

@karthik55
Copy link

I am getting ProtocolError With close Code 1000 and Message is Empty, any one come across issue. If so could you tell me the reason for the issue.

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

4 participants