Allign websocket sending close codes with RFC

未关闭
#1,642 4 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
38/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
python
领域
networking

调研方向

从 autobahn/websocket/protocol.py 约第 2054 行开始,将关闭代码验证与链接的 IANA WebSocket 关闭代码规则进行比较。确认代码 1000–1015 是如何处理的,以及实现是否有意排除这些代码。完成的标准是:受支持的标准关闭代码与所述 RFC 规则一致,并且相关行为已由项目现有的检查覆盖。

由索引模型根据 Issue 内容生成。

描述

needs-discussion websocket

Hi everyone,
I use autobahn with daphne/Django for a websocket application.
We got a usecase where we disconnect the client and reset the connection. To show this in the log files and properly us another reconnect strategy, we decided to use different websocket close codes. (e.g. 1012; Service Restart). We realized that this codes are not supported by daphne (https://github.com/django/daphne/issues/374). After looking around in the code I realized that this is implemented in the in this project.

Code: https://github.com/crossbario/autobahn-python/blob/master/autobahn/websocket/protocol.py#L2054

I am not sure why not all close codes are supported. Even the linked document in the code (https://www.iana.org/assignments/websocket/websocket.xml#close-code-number-rules) list all close codes.

Is there any reason why the close codes 1001-2999 are not supported? I think at least the defined codes 1000-1015 should be supported like described in the document.

I would create a MR, but the code look like this is intentional. :-)

Kind Regards
Sören

主要语言
Python
星标
2.5k
派生
766
平均合并
4 小时 24 分钟
30 天内合并 PR
20

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

crossbario/autobahn-python 的其他 Issue

查看 crossbario/autobahn-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。