0

I am using MongooseIM as my XMPP server, and this server typically use TCP as transport. This server works fine with my iOS client. But when I want to create the same service in web app, I found out that it does not work with any kind of javascript XMPP framework.

Because with browser, we cannot use TCP as transport. Instead, the alternatives are WebSocket and BOSH. When I use WebSocket with MongooseIM, it shows hand shake failed . While with BOSH, it shows 403 error. So does MongooseIM really work with WebSocket or BOSH?

And also, with TCP as my transport, the connection url is 'example.org', why it would be 'example.org/http-bind' with BOSH? Why is there the difference between 2 transport?

Phineas Lue
  • 317
  • 4
  • 15

1 Answers1

3

Pure XMPP TCP connection, BOSH and Websockets are quite different protocols. Both BOSH and Websockets use separate suffix (http-bind, ws-xmpp) to distinguish the endpoints if they are running on the same port. It spares the server some guessing what protocol is actually client going to use and provides nice separation.

What URL do you exactly use for BOSH and Websockets connection? In the former case it should be something like http://localhost:5280/http-bind and in the latter ws://localhost:5280/ws-xmpp.

What JS clients have you tried?

Piotr Nosek
  • 106
  • 2
  • I use Strophe.js and MongooseIM. I know there are some other servers which support BOSH and WebSocket, but I am wondering if MongooseIM support them. Because I do not want to modify my backend architecture. – Phineas Lue Feb 11 '15 at 23:31
  • Yes, MongooseIM does support both WebSockets and BOSH. We (disclaimer: I work on MongooseIM) have experience with using Strophe.js with BOSH, so it's definitely possible and should not require any changes in the client library or the server. I don't know whether with the WebSocket transport it's the same, but I have no reason to assume that it does not work. – erszcz Feb 12 '15 at 09:07
  • We need some more information Phineas. The first being what URL do you use for these connections. It would be even better if you could share your Strophe.js configuration. – Piotr Nosek Feb 13 '15 at 10:13