Skip to content
This repository has been archived by the owner on Aug 2, 2020. It is now read-only.

[BUG] access token 验证失败后,websocket服务端显示关闭连接,但是日志内仍然显示增加了一个客户端 #212

Closed
unsciorg opened this issue Sep 4, 2019 · 7 comments
Labels

Comments

@unsciorg
Copy link

unsciorg commented Sep 4, 2019

已成功向 7/7 个 WebSocket 客户端推送事件
[2019-09-04 03:46:28.233] [D] [WS] 收到 WebSocket 连接:/
[2019-09-04 03:46:28.233] [D] [WS] 没有提供 Token 或 Token 不符,已关闭连接
[2019-09-04 03:46:38.291] [D] [WS] 开始通过 WebSocket 服务端推送事件
[2019-09-04 03:46:38.294] [I] [WS] 已成功向 8/8 个 WebSocket 客户端推送事件

收到websocket连接以后,日志显示 Token不符合,关闭连接
但是下面的推送增加了一个websocket客户端

@stdrc
Copy link
Member

stdrc commented Sep 4, 2019 via email

@unsciorg
Copy link
Author

unsciorg commented Sep 4, 2019

收到

并没有收到数据,这时候确实是关闭的,但是我还没来得及浏览源代码,我猜测是没有将失败的客户端剔除出去,但是看日志确实是有发送这个动作。

@stdrc
Copy link
Member

stdrc commented Sep 4, 2019 via email

@stdrc stdrc added the Bug label Sep 6, 2019
@stdrc
Copy link
Member

stdrc commented Oct 15, 2019

看了下源码发现这个问题是正在用的 WebSocket 库的问题,准备换一个,进度见 #232 (可能要很久之后

@shigma
Copy link
Contributor

shigma commented Dec 7, 2019

提个小的建议。就是如果验证失败的话能不能直接 403 掉,就不建立连接了呢?因为从接受方的角度来说,如果每次收到的都是 json 还算比较好处理,但明明连接已经成功后却收到了 authorization failed 就显得有些奇怪了……(不知道是不是有其他的考虑?)

@unsciorg
Copy link
Author

unsciorg commented Dec 7, 2019 via email

@stdrc stdrc added this to the next milestone Dec 24, 2019
@stdrc stdrc removed this from the next milestone Jan 7, 2020
@stdrc
Copy link
Member

stdrc commented Feb 13, 2020

v4.14.0 已修复

@stdrc stdrc closed this as completed Feb 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants