public
Description: An XMPP BOSH session pre-initializer for Ruby web applications
Homepage: http://github.com/skyfallsin/ruby_bosh
Clone URL: git://github.com/skyfallsin/ruby_bosh.git
name age message
file .gitignore Wed Feb 18 08:34:12 -0800 2009 Initial commit to ruby_bosh. [skyfallsin]
file LICENSE Wed Feb 18 08:34:12 -0800 2009 Initial commit to ruby_bosh. [skyfallsin]
file README Wed Feb 18 13:43:20 -0800 2009 testing service hook [skyfallsin]
file Rakefile Fri Nov 06 20:54:17 -0800 2009 updated description in Rakefile [skyfallsin]
file TODO Wed Feb 18 12:23:57 -0800 2009 added timeouts, exceptions [skyfallsin]
file VERSION.yml Tue Apr 21 20:17:47 -0700 2009 Version bump to 0.5.4 [skyfallsin]
directory autotest/ Mon Feb 23 08:25:34 -0800 2009 added specs and autotest helpers [skyfallsin]
directory lib/ Wed Mar 25 06:28:51 -0700 2009 allowing client code to configure the bosh sess... [willbailey]
file ruby_bosh.gemspec Fri Nov 06 20:53:15 -0800 2009 updated gemspec [skyfallsin]
directory spec/ Sun Mar 15 20:04:30 -0700 2009 fails with a generic RubyBOSH::Error on any exc... [skyfallsin]
README
ruby_bosh
=========

The RubyBOSH library handles creating and pre-authenticating BOSH streams inside your Ruby application before passing 
them off to your template engine. 

This method allows you to hide authentication details for your users' XMPP accounts.  

Tested on Rails 2.x with eJabberd 1.2+

References
==========
BOSH: http://xmpp.org/extensions/xep-0124.html
XMPP via BOSH: http://xmpp.org/extensions/xep-0206.html

Example
=======
In your Ruby app controller (or equivalent):

@session_jid, @session_id, @session_random_id = 
  RubyBOSH.initialize_session("me@jabber.org", "my_password", "http://localhost:5280/http-bind")

In your template, you would then pass these directly to your javascript BOSH connector:

var bosh_jid = '<%= @session_jid %>';
var bosh_sid = '<%= @session_id %>';
var bosh_rid = '<%= @session_random_id %>';

// using Strophe:
connect.attach(bosh_jid, bosh_sid, bosh_rid, onConnectHandlerFunction); 

Acknowledgements
================
Jack Moffit
- thanks for the nice Django example :)
#=> http://metajack.im/2008/10/03/getting-attached-to-strophe/

Copyright (c) 2008 Pradeep Elankumaran. See LICENSE for details.