Round III, now with BOSH.
After attempt 1 and attempt 2 trying to connect XIFF to ejabberd without applying any patch to ejabberd I finally tried with BOSH connection and IT WORKED!!!
Below are the steps I followed to test a chat example.
- install latest SVN XIFF version (Checked out revision 10959)
export TEST_DIR=/tmp/xiffstep1 mkdir -p $TEST_DIR/xiff cd $TEST_DIR/xiff svn co http://svn.igniterealtime.org/svn/repos/xiff/trunk/src/org org
- install latest SVN ejabberd version (revision 1867)
cd $TEST_DIR svn co http://svn.process-one.net/ejabberd/trunk/ ejabberd_src cd $TEST_DIR/ejabberd_src/src ./configure --prefix=$TEST_DIR/ejabberd make sudo su make install
- install mod_http_bind in ejabberd and load module in ejabberd.cfg (see this article).
cd $TEST_DIR/ svn co http://svn.process-one.net/ejabberd-modules ejabberd_modules_src cd $TEST_DIR/ejabberd_modules_src/http_bind/trunk ./build.sh sudo su cp ebin/*.beam $TEST_DIR/ejabberd/lib/ejabberd/ebin/ # load mod_http_bind in ejabberd.cfg: {mod_http_bind,[]}, # add request_handler in ejabberd.cfg: {request_handlers, [{["http-bind"], mod_http_bind}]} cd $TEST_DIR/ejabberd/etc/ejabberd wget http://www.keoko.net/wp-content/uploads/2009/02/ejabberd.cfg - setup ejabberd and create two users (sender, receiver).
cd $TEST_DIR/ejabberd/sbin ./ejabberdctl start ./ejabberdctl register user1 localhost user1 ./ejabberdctl register user2 localhost user2
- install nginx and configure it as reverse proxy to ejabberd
sudo apt-get install nginx sudo vim /usr/local/nginx/conf/nginx.conf # add the following lines after location / block location /xmpp-httpbind { proxy_pass http://localhost:5280/http-bind; break; } sudo killall nginx sudo /usr/local/nginx/sbin/nginx - get chat example files: XIFFstep1BOSH.mxml and TestChatBosh.as (this example is based on this article).
cd $TEST_DIR/xiff wget http://www.keoko.net/wp-content/uploads/2009/02/xiffstep1bosh.mxml wget http://www.keoko.net/wp-content/uploads/2009/02/testchatbosh.as
- create AS3 project “XIFFstep1BOSH” with eclipse + Flex Builder, import library XIFF and example file into the project and run the application.
# run eclipse File > New > Flex Project -> Project Name: XIFFstep1Bosh Delete > XIFFstep1BOSH.mxml File > Import > General > File System > Next > From directory: $TEST_DIR/xiff Run > Run
- open another XMPP client (e.g. Psi) with user2.
- send message through the flash application in the browser window that has been opened.
- check the message has been received in the other XMPP client (user2).
Mickaël Rémond was right: XMPP works with flash out of the box … with BOSH connections, not with XML socket connections.
[...] not work with Flash out of the box. work with flash out of the box … with BOSH connection, not with XML socket connection (see Experiences with ejabberd and flash (III). [...]
Hi,
I tried creating a Flex Project with the above mentioned steps and after importing the xiff folder, I get the following error when I try to save the file :
Attempted access of inaccessible property jid through a reference with static type org.jivesoftware.xiff.core:JID. XIFFstep1Bosh/src/org/jivesoftware/xiff/core
Please let me know where I am going wrong..
Thanks for the help in advance,
Murali Raju.
Hi,
I am getting this error now when I overwrite all the files when importing the xiff folder into Flex Project folder :
Application file src\xiff_as3_flexlib_beta1.as does not exist. XIFFstep1Bosh
Thanks,
MuraliRaju
Don’t suppose you found a working version of xiff that support sasl socket authication?
I’ve got bosh working a treat (haven’t lots of hacking to make it xmpp compliant), however sockets in xiff seems really really outdated
Hi,
I’m trying to connect to Jabber.org server (which is a eJabberD 2.x) using XIFF API and BOSH connection. But I’m unable to do so. I checked your code and tried both connection.connect(”flash”) and connection.connect(”standard”).
I’m able to authenticate on Jabber.org but when I send the resource bind packet I never receive a response.
I have put my query on http://www.igniterealtime.org/community/thread/39395. Can you please check it and guide me? This problem is making me go mad.
Regards,
Shubhra