BUG: Incorrect WebSocket status code 1005 description, missing status code 1006
See original GitHub issueDiscussed in https://github.com/encode/starlette/discussions/1577
<div type='discussions-op-text'>Originally posted by vbsd April 7, 2022 It seems that there is a mistake in starlette’s WebSocket status code list.
Status code 1005 has the name 1005_ABNORMAL_CLOSURE
and 1006 is missing altogether. However, Mozilla MDN docs indicate that 1005 actually means “no status received”. It is status code 1006 that means “abnormal closure”.
It looks like what should have been
WS_1005_NO_STATUS_RECEIVED = 1005
WS_1006_ABNORMAL_CLOSURE = 1006
got mashed together and became just one line:
WS_1006_NO_STATUS_RECEIVED = 1005
Making starlette backwards-incompatible over this wouldn’t make much sense, but it seems reasonable to at least add the two correct lines and document WS_1005_ABNORMAL_CLOSURE
as deprecated/wrong.</div>
Issue Analytics
- State:
- Created a year ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Getting the reason why websockets closed with close code 1006
Close Code 1006 is a special code that means the connection was closed abnormally (locally) by the browser implementation. If your browser client...
Read more >[SOLVED] code server WebSocket close with status code 1006
The websocket 1006 error means that the connection has been closed, locally, by your browser. If you see a close code 1006, you...
Read more >websockets.exceptions — websockets 8.1 documentation
Source code for websockets.exceptions ... error", 1003: "unsupported type", # 1004 is reserved 1005: "no status code [internal]", 1006: "connection closed ...
Read more >QWebSocketProtocol Namespace | Qt WebSockets 6.4.1
Status codes 1005 and 1006 are added and all codes are now unsigned Internal error results in 1006. Not supported by QtWebSockets.
Read more >The WebSocket protocol - IETF Datatracker
It is inappropriate to use Internet-Drafts as reference material or to cite ... Any status code other than 101 indicates that the WebSocket...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
But you’re right. It’s an issue.
It’s quite sensitive tho…
My messages above doesn’t make any sense, as the variable name needs to change. I’ve created #1580.