开发者

XMPP over HTTP or over socket

开发者 https://www.devze.com 2023-03-17 15:00 出处:网络
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 c开发者_StackOverflow中文版an support clients to b

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 c开发者_StackOverflow中文版an support clients to be on different network than the server?


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号