question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BUG: Incorrect WebSocket status code 1005 description, missing status code 1006

See original GitHub issue

Discussed 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:closed
  • Created a year ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
Kludexcommented, Apr 7, 2022

But you’re right. It’s an issue.

It’s quite sensitive tho…

1reaction
Kludexcommented, Apr 7, 2022

My messages above doesn’t make any sense, as the variable name needs to change. I’ve created #1580.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found