问题描述
对于移动聊天室的一些要求:
Some requirements for a mobile chat room:
-
应该能够与客户的频繁连接/断开无缝工作,由于移动网络
Should be able to work seamlessly with client's frequent connect/disconnect due to the mobile network
节省带宽(减少开销)
我没有在XMPP的经验,我只有用Node.js的服务器的工作,很容易安装和使用JavaScript黑客服务器。
I don't have experience in XMPP, I only have worked with Node.JS server and it is easy to setup and hack the server with JavaScript.
但似乎XMPP是聊天室,如事实标准WhatsApp的使用它们。任何人都可以在这两种技术分享你的经验?
But seems XMPP is the defacto standard for chat room, e.g. WhatsApp use them., anyone can share your experience in these two technologies?
推荐答案
你是哪种问我怎样才能到我的目的地,我开我的车,或者乘坐铁轨。如果你去的铁轨,你还是要建立你的火车。
You are kind of asking how can I get to my destination, should I drive my car, or take the railroad tracks. If you go with the railroad tracks, you still have to build your train.
XMPP主要用于聊天和擅长于该空间。 WebSockets的是波什在XMPP更为相似,扩展,允许双向通信通过HTTP。的WebSockets仅仅是一个连接协议,而不是实际支持聊天的概念的实时消息传递协议。我推测,在未来,将有一个扩展加入XMPP支持WebSockets的,不如说是天作之合。
XMPP is primarily used for chat and excels in that space. Websockets is much more similar to BOSH in XMPP, an extension to allow two way communications over HTTP. Websockets is just a connection protocol, as opposed to a realtime messaging protocol that actually supports the concept of chat. I would speculate that in the future, there will an extension added to XMPP to support Websockets, as it is a natural fit.
不是说你不能使用的WebSockets,只是你还是要建立在它之上的聊天的协议,而不是使用现有的许多服务器一应俱全。
Not saying that you can't use Websockets, just that you will still have to build the 'chat' protocol on top of it, as opposed to using an existing one with many servers readily available.
这篇关于开发一个移动聊天室,后端使用XMPP或WebSocket的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!