Skip to content
New issue

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

建议事件消息上报增加WebSocket方式 #190

Open
whenov opened this issue Jan 22, 2018 · 4 comments
Open

建议事件消息上报增加WebSocket方式 #190

whenov opened this issue Jan 22, 2018 · 4 comments
Labels

Comments

@whenov
Copy link

whenov commented Jan 22, 2018

sjdy521你好,我想尝试写一个具有QQ/Wechat基本功能的网页版客户端,仅包括浏览器前端部分。

但是目前Mojo-Webqq(以及Mojo-Weixin)的事件上报机制均使用POST到指定地址的方式,这就需要客户端另外包含一个HTTP Server(如果我没有理解错的话)。而如果能够增加WebSocket的事件消息上报机制,就可以用纯前端实现QQ/Wechat客户端了。

目前能想到的不依赖上游的解决方案是,在Docker中同时安装一个Node.js服务端,将post_api接收到的POST内容全部转发到WebSocket上去。但是如果能在上游直接用perl解决就最好不过了。

@hexsum
Copy link
Owner

hexsum commented Jan 22, 2018

websocket方式我会考虑支持一下 当前你可以在浏览器端通过ajax重复访问/openqq/check_event 这个api来实现拉取消息(类似网页qq和网页微信的long-polling模式),就不需要搞一个server来接收post信息了 详情可以参考API.md接口文档

@hexsum
Copy link
Owner

hexsum commented Jan 22, 2018

写一个仅包含前端的控制台页面一直是我所想要的 无奈自己的前端水平比较菜 一直没有动起手来, 很希望你如果写好了能够分享一下

@whenov
Copy link
Author

whenov commented Jan 23, 2018

感谢~check_event的API我也看到了,但是功能和性能似乎都很有限,因此才考虑post_api。

@hexsum
Copy link
Owner

hexsum commented Jan 23, 2018

@whenov 或者通过多账号管理的api应该可以弥补check_event的不足之处 https://github.com/sjdy521/Mojo-Webqq/blob/master/Controller-API.md
WebSocket的方式是一个很好的建议,我后续会考虑实现下

@hexsum hexsum added the feature label Jan 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants