通过 HTTP 或通过套接字的 XMPP

发布于 2024-11-19 04:19:41 字数 86 浏览 0 评论 0原文

我想知道是否必须实现 XMPP 客户端,哪种连接是最好的方式,使用套接字还是 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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

满地尘埃落定 2024-11-26 04:19:41

我认为socket和bosh之间最大的区别是bosh使用HTTP,它是无状态(连接关闭)与插座。这意味着您在使用 BOSH 时可以从浏览器内连接到 XMPP。我不明白为什么你想要创建一个 BOSH 客户端,因为 strope.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.

聊慰 2024-11-26 04:19:41

这当然不是所有优点和缺点的明确列表,而是我在尝试实现跨网络加密 Openfire 连接时遇到的优点和缺点。

套接字
Socket Connection的优点之一:支持自动TLS加密。

套接字连接的一个可能的缺点:我最近了解到,如果 Openfire 服务器与连接到该服务器的客户端位于不同的网络上,则使用套接字连接可能会成为一个问题,在这种情况下,连接到服务器的能力可能会受到影响。受连接网络防火墙和通过标准 5222 Socket 端口连接的能力的影响。

HTTP-Bind

Http-Bind Pro:可以通过使用标准Http端口来缓解上述的网间连接问题。

Http-Bind 的缺点之一:似乎不支持自动 TLS 加密,而是依赖“旧 SSL”标准进行加密通信,而许多 XMPP 库似乎并不支持该标准。

This is certainly not a definitive list of all the pros and cons but rather the ones I have come across while trying to implement a cross network encrypted Openfire connection .

Socket
One Pro of Socket Connection: supports auto TLS encryption.

One Possible Con of Socket Connection: I have recently learned that using socket connections can be an issue if the Openfire Server is on a different Network than the Client connecting to that server, in which case the ability to connect to the server can be at the mercy of the connecting networks firewall and ability to connect via the standard 5222 Socket port.

HTTP-Bind

Pro of Http-Bind: Can alleviate the aforementioned problem of inter-network connections by using the standard Http port.

One Con of the Http-Bind: Does not appear to support the auto TLS encryption and instead relies on the 'Old SSL' standard for encrypted communication, which many XMPP libraries don't appear to support.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文