如何创建消息服务?
我想创建一个使用 XMPP 协议的消息传递服务。 我将如何实现该服务的服务器端和客户端方面? 我知道我需要一个运行消息传递框架的服务器(如 Jabberd 2)。 设置和运行有多难? 另外,将客户端程序连接到该服务的最佳方法是什么? 我如何开始通过服务器将消息从一个客户端推送到另一个客户端?
I want to create a messaging service that uses the XMPP protocol. How would I implement the server-side as well as the client side aspects of this service? I know I would need a server (like Jabberd 2) that runs the messaging framework. How hard would this be to set up and get running? Also what would be the best way to hook up a client program into this service? How would i start pushing messages from one client, through the server, to another client?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
服务器:有很多,请参见http://xmpp.org/software/servers.shtml 获取列表。
我过去使用过 OpenFire,设置起来相当简单。
您可以将 xmppframework 这样的库添加到您的 Cocoa 项目中,使其成为客户端,并配置它与您的 XMPP 服务器对话。
每个客户端都会获得一个以下形式的标识符(称为'jid'):[电子邮件受保护],并且您可以通过将消息发送到目标收件人的jid,将消息从一个客户端发送到另一个客户端。
如果您想使用脚本语言尝试简单的示例,您可以使用 python xmpp 库中的示例< /a> 看看它是如何工作的。 使用 xmpp 客户端,例如 psi 作为一个 jid 连接,并使用示例作为另一个 jid 连接,通过服务器发送/接收消息。
Server: there are many out there, see http://xmpp.org/software/servers.shtml for a list.
I've used OpenFire in the past, it's fairly straightforward to set up.
You can add a library like xmppframework to your Cocoa project to make it a client, and configure it to talk to your XMPP server.
Each client gets an identifier (called a 'jid') of the form: [email protected], and you send messages from one client to the other by addressing them to the jid of the intended recipient.
If you want to play around with simple examples in a scripting language, you can use something like the examples in the python xmpp library to see how it all works. Use an xmpp client like psi to connect as one jid and use the examples to connect as another jid to send/receive messages through the server.