When I was writing Flash and ejabberd experiences article, I thought to include all the detailed steps but I was afraid of repeating once more all the steps. However, after having some doubts whether it was really necessary to apply a patch to ejabberd I think it’s worth to review some of them.

Below are the steps I followed to test a chat example.

  1. 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
  2. install latest SVN ejabberd version (2.0.2)
    cd  $TEST_DIR
    svn co http://svn.process-one.net/ejabberd/tags/ejabberd-2.0.2/ ejabberd_src
    cd $TEST_DIR/ejabberd_src/src
    ./configure --prefix=$TEST_DIR/ejabberd
    make
    sudo su
    make install
  3. 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
  4. get chat example files: xiffstep1.mxml and TestChat.as. Note this example is based on this article.
    cd $TEST_DIR/xiff
    wget http://www.keoko.net/wp-content/uploads/2009/02/xiffstep1.mxml
    wget http://www.keoko.net/wp-content/uploads/2009/02/testchat.as
  5. create AS3 project “Test1″ 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: XIFFstep1
    Delete > XIFFstep1.mxml
    File > Import > General > File System > Next > From directory: $TEST_DIR/xiff
    Run > Run
  6. send message through the flash application in the browser window that has been opened.
  7. check XML/jabber communication.
    • Request:
      <policy-file-request/>
    • Response:
      <?xml version='1.0'?>
      <stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='3095424478' from='localhost' xml:lang='en'>
      <stream:error>
      <invalid-namespace xmlns='urn:ietf:params:xml:ns:xmpp-streams'/>
      </stream:error>
      </stream:stream>

As pointed out by Mickaël Rémond in this comment, XIFF is not XMPP compliant. It’s clear on the XML request. However, I still don’t see how to connect XIFF with ejabberd without applying the patch mentioned on the first part. BOSH seems the only alternative.

Any suggestion?