We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
ctx.http.ws
使用 HTTP 服务 (@koishijs/plugin-http) 的 ctx.http.ws 时, 远端拒绝会造成 APP 出现错误 Error: connect ECONNREFUSED 0.0.0.0:443, 即使不在插件的 apply 函数内运行仍会发生, 后 Koishi 崩溃自动重载, 且对该代码行使用 try-catch 无法捕获拒绝连接的异常 (我 await 了也不行).
Error: connect ECONNREFUSED 0.0.0.0:443
依赖 HTTP 服务后, 在任意位置执行如下 ts (确保 ctx 为插件的 Context)
ctx.http.ws('wss://0.0.0.0')
异常可被 try-catch 捕获处理, 即使未被处理也不应使 Koishi 崩溃, 而应使插件报错停止流程
No response
The text was updated successfully, but these errors were encountered:
此问题由 ws 这个库和 node 底层的实现导致。
目前的解决方案是确保任何创建出的 WebSocket 实例都有 onerror。
当 node 最低版本变为 22 以上版本时,将会替换底层实现以解决此问题。
Sorry, something went wrong.
No branches or pull requests
Describe the bug
使用 HTTP 服务 (@koishijs/plugin-http) 的
ctx.http.ws
时, 远端拒绝会造成 APP 出现错误Error: connect ECONNREFUSED 0.0.0.0:443
, 即使不在插件的 apply 函数内运行仍会发生, 后 Koishi 崩溃自动重载, 且对该代码行使用 try-catch 无法捕获拒绝连接的异常 (我 await 了也不行).Steps to reproduce
依赖 HTTP 服务后, 在任意位置执行如下 ts (确保 ctx 为插件的 Context)
Expected behavior
异常可被 try-catch 捕获处理, 即使未被处理也不应使 Koishi 崩溃, 而应使插件报错停止流程
Screenshots
Versions
Additional context
No response
The text was updated successfully, but these errors were encountered: