XMPP 通过 HTTP 或通过套接字 [英] XMPP over HTTP or over socket

查看:30
本文介绍了XMPP 通过 HTTP 或通过套接字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道我是否必须实现一个 XMPP 客户端,哪种连接是最好的方式,使用 socket 还是 BOSH?优缺点都有什么?我假设两者都可以支持客户端与服务器位于不同的网络上?

I was wondering if I have to implement a XMPP client, which connection is the best way, using socket or BOSH? What are the pros and cons? I assume both can support clients to be on different network than the server?

推荐答案

我认为 socket 和 bosh 最大的区别在于 bosh 使用的是 HTTP,即 无状态(连接关闭)与套接字.这意味着您可以在使用 BOSH 时从浏览器中连接到 XMPP.我不明白你为什么要创建一个 BOSH 客户端,因为 strophe.js 是一个非常好的 bosh客户.此外,几乎所有可用语言都已经有了套接字实现.如果你问我,这就是关于 XMPP 的好想法.

I think the biggest difference between socket and bosh is that bosh uses HTTP which is stateless(connectection closed) vs socket. That means you can connect to XMPP from within the browser when using BOSH. I don't understand why you would want to create a BOSH client, because strophe.js is a very nice bosh client. Also there is allready a socket implementation in almost any available language. That is the nice thinkg about XMPP if you ask me.

这篇关于XMPP 通过 HTTP 或通过套接字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆