WebSockets rewrite
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 25/100
- Issue 类型
- 重构
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- javascript, nodejs, wordpress
调研方向
Review the changes described for wsConnectUserToServer in api2.js, the wpIdentity WebSocket package switch, and the Caddy configuration shown in the issue. Check the server log and client behavior against the retry limits and WebSocket routing; done means failed connections no longer retry indefinitely or fall back to HTTP unexpectedly.
由索引模型根据 Issue 内容生成。
描述
There have been problems over time with the WebSocket functionality in WordLand and wpIdentity. But I think I've gotten it stabilized, and since @scotthansonde was involved in this, a long time ago, I thought I should close the loop.
- I rewrote wsConnectUserToServer in api2.js to wait 10 seconds between retries after a failed connection, and to only try 100 times, and after that it gives up. You can reload the page to get another set of tries. Previously it waited 1 second and retried indefinitely.
- I switched the websockets package wpIdentity was using from nodejs-websocket to ws. This was based on advice I got from ChatGPT and Claude.ai, saying that nodejs-websocket was not being maintained, and the gold standard for everyone was ws.
- I changed the Caddy config file on the server, per the advice of ChatGPT, to make sure that failed WS connections didn't fall back to HTTP connections, which is what I was seeing in the logfile, along with the steady stream of errors in the user's JS console (this came up the other day in a bug report on the wordlandSupport repo issues list.
The result? It's much calmer in the server log. This is kind of mysterious, I didn't expect it to settle down so quickly because there must have been some old clients out there reconnecting every second?
The new Caddy file
{
on_demand_tls {
ask http://localhost:1339/isdomainvalid
}
}
https:// {
tls {
on_demand
}
@websocketsWordlandSocial {
host wordland.social
header Connection *Upgrade*
header Upgrade websocket
}
@httpWordlandSocial {
host wordland.social
}
reverse_proxy @websocketsWordlandSocial localhost:1502
reverse_proxy @httpWordlandSocial localhost:1339
# Optional: fallback for other domains
reverse_proxy localhost:1339
}
Screen shot of server log with a client trying to connect every second
- 主要语言
- JavaScript
- 星标
- 21
- 派生
- 2
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
scripting/wpIdentity 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 25/100
scripting/wpIdentity#6 ·
-
难度 5/5 一周以上 新手友好度 25/100
scripting/wpIdentity#5 · 2 条评论 ·
-
难度 5/5 一周以上 新手友好度 20/100
scripting/wpIdentity#2 · 2 个 reaction ·
-
难度 4/5 3-5 天 新手友好度 25/100
scripting/wpIdentity#1 ·
查看 scripting/wpIdentity 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
-
area-deployment area-integrations triage:bot-seen
难度 2/5 半天 新手友好度 86/100
-
Issue-Bug
难度 2/5 1-3 小时 新手友好度 68/100
sugarlabs/musicblocks#8924 ·
-
难度 1/5 1 小时以内 新手友好度 90/100
ArduPilot/ardupilot_wiki#8088 ·
-
[BUG] createTool tools cannot be registered with Mastra when exactOptionalPropertyTypes is enabled 未关闭customer-eng status: needs triage
难度 2/5 1-3 小时 新手友好度 84/100