Skip firewall with XMPP Http-Bind

0

Hi, I know that you can do an XMPP with ports 80 or 443 for this, there are services such as jwchat, and through a web, the configuration is used to use port 80. I need documentation or someone who knows about it. Thank you

    
asked by Perl 10.10.2016 в 13:17
source

1 answer

0

You can use XMPP on BOSH link

Basically it is a long polling on http or https, it is supported by most libraries including Strophe.js.

I've used it with Ejabberd as a server and Strophe as a client without problems.

Update:

Basically ejabberd will be listening on the 5280, you will need a nginx or similar to rewrite the / http-bind to the host: 5280 / http-bind. Then simply tell strophe (or whatever you use) to point to host / http-bind. Here is a sample configuration for nginx and ejabberd: link

With the strophe

var connection = new Strophe.Connection('http://host/http-bind');
connection.connect('domain/pubsub','', function(status){
  switch(status){
     case Strophe.Status.CONNECTED:
         console.log('connected');
         connection.subscribe('key', [], function(event){
             console.log($(event).find('entry').text());
         });
         break;
     case Strophe.Status.DISCONNECTED:
         console.log('disconnected');
  }
});
    
answered by 11.10.2016 в 18:27