[ejabberd] Strange usage of BOSH

William Edney bedney at technicalpursuit.com
Mon Aug 3 03:51:01 MSD 2009

Folks -

I have kind of a strange use case for BOSH. Jack Moffitt and I  
discussed it a bit (thanks Jack!) and I realized that step #1, in some  
sense, was to make sure that ejabberd could do this.

What I would like to do is to use the BOSH protocol to make a XMPP  
'component' available to an ejabberd server. In other words, I want to  
write a XEP-114 compliant 'server component' in JavaScript that would  
live in the browser, but to the ejabberd server it would look like a  
server-side component.

I have my own JS library that implements XEP-124/XEP-206 and have done  
a reasonable job of factoring (well, it might need a bit of work) so  
that the low-level XEP-124 transport layer is separate from the higher  
level XEP-206 stuff. This library can currently communicate well with  
the regular mod_http_bind module in ejabberd using the standard  
client<->server workflow that most people use BOSH for.

I assume that to make this work I would use the XEP-124 functionality,  
but then layer XEP-114 on top of it.

A few questions:

#1. I assume that the XEP-124 part of BOSH does not preclude this from  
working, in theory. Right or wrong?

#2. Does ejabberd's BOSH implementation, as currently coded in  
mod_http_bind, preclude this functionality (i.e. are there assumptions  
in that code that would prevent it from working)?

#3. If ejabberd's current BOSH implementation would allow for this,  
what would the 'config' file look like?

I'm not an Erlang programmer, so my knowledge is really limited, but  
I've seen entries like this:

{8888, ejabberd_service, [{access, all}, {shaper_rule, fast},
{hosts, ["foo.process-one.net"],
[{password, "bar"}]}

What would an entry look like for a component that 'lives on the other  
side of BOSH' ? I mean, there's really no port as such (or is there?).  
Do I even need such an entry? If I don't, what would the 'handshake'  
use as a 'server secret'?

Thanks in advance!!


- Bill

More information about the ejabberd mailing list