node.jsubuntuconverse.jsnode-xmpp

troubling getting conversejs 3.2.1 working with node-xmpp running on Ubuntu 16.04


I'm trying to configure conversejs 3.2.1 to work with node-xmpp-bosh running on Ubuntu 16.04. Node version is 4.2.6.

Using default configs found in "bosh.conf.example.js", node-xmpp-bosh starts correctly and is listening on port 5280. This is confirmed by visiting http://my-bosh-cm-IP:5280/http-bind and the following web page displays:

node-xmpp-bosh on ip-172-31-15-30
Bidirectional-streams Over Synchronous HTTP

Uptime: 00:35:15
1/1 active sessions
1/1 active streams

Conversejs appears to connect in some fashion to node-xmpp (that's the 1/1), and through it, to the target XMPP server, though the contacts list of the account that is used for login isn't displaying in the control box (As a side note, when I test using the conversejs.org BOSH connection manager, the contacts list appears properly in the control box.)

However, when an SMS is sent to the account logged in, conversejs does NOT display a chatbox with the text message, and the following errors appear immediately in the console:

sounds/msg_received.ogg:1 GET http://dev.myserver.com/sounds/msg_received.ogg net::ERR_ABORTED
sounds/msg_received.mp3:1 GET http://dev.myserver.com/sounds/msg_received.mp3 net::ERR_ABORTED
status.php:1 Uncaught (in promise) DOMException: Failed to load because no supported source was found.

This seems to imply the message was received, but conversejs was unable to display it in a chatbox for some undisclosed reason. Repeated messages sent result in the same error statements, so clearly some portion of the messaging is making it to conversejs, but apparently not "digestible" and/or displayable by conversejs.

I realize node-xmpp is a somewhat dated project, but hoping it is still serviceable to provide the BOSH connection management service needed.

I realize that this question may be lacking in enough detail to provide a direct answer to the issue (happy to provide more), but any insight or pointers on where to look, or something I'm overlooking would be much appreciated. And if someone is using a different BOSH connection manager and has that working, if you could share what that is, I'd love to know.

Thanks in advance.


Solution

  • Turns out the issue was about XMPP ports not being added to firewall. In order for BOSH connection managers to operate with XMPP servers, the firewall protecting the BOSH CM machine will need to allow one or more the following inbound TCP ports:

    5222 XMPP client connection
    5223 XMPP client connection over SSL
    5269 XMPP server connection
    
    5298 XMPP (TCP / UDP) Link-local messaging. Serverless Messaging 
    8010 XMPP File Transfers
    

    Once the ports were opened, the connection set right up. Hope this is helpful.