我正在寻找一个框架,它可以从服务器向浏览器提供实时更新,就像它用于网络聊天、谷歌波、谷歌 Buzz、Facebook 等一样。
我找到了 Rocket GWT但最后一次更新是一年多前...
对我来说,最好的实现是在客户端使用 GWT,在服务器上使用 JSON 作为通信协议(protocol)和 C++,但也欢迎任何其他框架,只是为了看看它是否可行:) google 使用的是哪个框架?
最好的问候, 斯蒂芬
最佳答案
看看 websockets,它最终将成为双向客户端-服务器网络通信的标准。
- http://en.wikipedia.org/wiki/WebSocket
- https://datatracker.ietf.org/doc/html/draft-ietf-hybi-thewebsocketprotocol-10
- http://onepixelahead.com/2010/04/30/html5-web-sockets-example/
- http://today.java.net/article/2010/04/26/html5-server-push-technologies-part-2
可以在这些表格中查看当前支持:
- http://en.wikipedia.org/wiki/Comparison_of_layout_engines_%28HTML_5%29#Related_specifications
- http://caniuse.com/#search=websocket
由于在不久的将来(从 2011 年 8 月起)支持仅在 Safari、Firefox 和 Chrome 中可用,也许一些故障转移库会派上用场:
You want it to work in all browsers, no matter if they have WebSocket support or not? You don't want to rely on proprietary technology such as Flash to provide a fallback And naturally, you don't want to write more than one implementation?
Introducing, the gracefulWebSocket jQuery plugin: Implements the w3c WebSocket interface Wraps the native WebSocket if support is detected Provides a default fallback using traditional AJAX polling over HTTP Requires no extra code on the frontend, allows you to target the WebSocket API today and let users take advantage of it as more browsers add support. Default fallback behavior can be overridden by plugin options
关于javascript - 浏览器的实时服务器更新,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7024558/