XMPP over HTTP or over a socket

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

+4
source share
2 answers

I think the biggest difference between socket and bosh is that bosh uses HTTP, which is stateless (connection closed) against the socket. This means that you can connect to XMPP from a browser using BOSH. I do not understand why you want to create a BOSH client, because strophe.js is a very good bosh client. Also, there is already an implementation of the socket in almost any available language. This is a good idea about XMPP if you ask me.

+3
source

This, of course, is not the final list of all the pros and cons, but rather the ones I came across when trying to implement Openfire's cross-network encrypted connection.

Socket One Pro Rim : supports automatic TLS encryption.

One possible way to connect sockets: I recently found out that using socket connections can be a problem if Openfire Server is on a different network than the client connecting to this server, in which case the ability to connect to the server may be under the control of the connecting network firewall and connectivity through the standard Socket 5222 port.

HTTP Bind

Pro for Http-Bind: May fix the aforementioned interconnect problem using the standard Http port.

One Http-Bind loop: does not support TLS automatic encryption and instead relies on the Old SSL standard for encrypted communications, which apparently is not supported by many XMPP libraries.

+1
source

All Articles