Archive for the ‘XIFF Library’ Category

XIFF ActionScript 3.0 Demo source released

Tuesday, October 30th, 2007

Several people have requested that I release the demo source for the debug Flex application I built. I have been very hesitant to release it because it was essentially a very rough prototype meant only to test the xiff library I ported to AS3. It was not really meant as a tutorial, especially since it is not documented, commented and there really was very little thought put into structure. I simply have not had time to clean it up at all.

It has been quite a while since I have posted much on XIFF. This is not at all to do with a lack of interest, mostly a lack of extra time.

Just go to the same location as the demo, right-click and view source.
http://velloff.com/XIFF_AS3/XIFF_AS3_GUI.html

Good luck, and please post examples of what you come up with!

AVM2 Socket added to XIFF Library

Thursday, September 7th, 2006

I added flash.net.Socket to the XIFF library. It allows you to use AVM2's built in Socket support to connect directy to the xmpp server without the need for XML Socket.

The benefits of this are:

1. Performance increase… Socket writes directly to Flash's memory and removes the need for an abstracted XML Socket connection.

2.  Removes the "null byte" issue Flash has with talking dirrectly to Socket servers. In theory, xiff should now be able to talk to any xmpp socket server without any unique Flash support (ie. hacks to the server)… provided there is a security policy for -or- the swf is hosted on the exact same domain that the server runs. It will be much easier to get an administrator to put a policy file on their server than to get them to hack it to support a Flash XML Socket connection.

Next I'll tackle the HTTP binding support! 

Both the demo and the bot are now running on the new Socket connection. See it here.

ActionScript3 XIFF Alpha Demo – New *Bot*

Tuesday, September 5th, 2006

Well I quickly realized that joining a chat room with no one there was not an effective way to test the library. Even though I am generally on my computer 20 hours a day, it's not all the time..

There will now be a "bot" automatically added to your roster when you register on the server. If it starts to get on your nerves, just message "quiet" to him and you will not receive any new messages.

Debugging

Please post any comments for bugs that you find on the alpha… It will assist in the early library release. 

 The library post is located here. Check out the demo- 

NEW ActionScript 3 XIFF Version – for Flex Builder 2 projects with XMPP

Friday, September 1st, 2006

Spice up your Flex Builder 2 projects with XMPP, using an newly ported ActionScript 3 version of XIFF 

–>If you would like to skip to the Flex demo of the messenger just go here.

A few months ago I started working on a complex RIA that required an instant messenger type component.  We decided to use Flex Builder 2 and ActionScript 3 to developer the application. I quickly realized that with ActionScript 3 being so new (in terms of official release) that there was no real standardized way to add the component. So I started exploring different options, weighing the benefits and drawbacks of various technologies. Licensing cost, scalability, reusability, maintenance and standardization were among the main criteria I used to come to an effective solution.

Where I landed was a bit of a hybrid. I decided to utilize Jabber for the textual component of the software.

"Jabber is best known as "the Linux of instant messaging" — an open, secure, ad-free alternative to consumer IM services like AIM, ICQ, MSN, and Yahoo…" from Jabber

Combine this with Flash Media Server for the video chat and you have a solid messaging platform. (FMS integration is out of the scope of this blog but I am sure I will be documenting my experience with it at a later date.)

In order to satisfy the business needs of this project I needed to combine

-the built in Flash XML socket functionality;

-a standardized xml specification called xmpp (Jabber);

-an open source server that supports this specification (Wildfire server in 
 my case);

-and an open source xmpp api called XIFF.

The only rub, XIFF was currently in beta and written in ActionScript 2.

XIFF is a Flash API for instant messaging and presence using the XMPP protocol. The main developer, Sean Voisen had a solid, object oriented library from which to start an AS3 port.

I decided it made more sense to take an existing well written library and port it than start from scratch. Given that this library is protected by a limited GNU license it also meant I would be giving something back to the Flash community, which, has been an immeasurable asset to me over the years.

I teamed up with a super talented developer, Derrick Grigg and got to work. Let me tell you, converting a large library of AS2 code to AS3 is no small task. The rules for AS3 have definitely changed. All the methods that pulled null results and thus silently failed are silent no more! You’ll quickly see the reason for “try…catch…finally” as there is nothing silent about a failure in AS3. The support for runtime errors is huge and ultimately makes a library like this much more stable. The prototype decoration that solved for multiple inheritance issues… not supported (I say that, knowing full well there is a way to do it… it's just not pretty). AS3 loves using the inheritance chain the way it was intended.

So now that the new AS3 library is (almost) available, here are some summary stats..

Features:

XIFF includes an extension architecture that makes it easy to add functionality for additional protocol extensions, or even your own special-needs extensions. There are quite a few extensions already included in the library, giving it support for the following functionality:

• XML-RPC over XMPP (JEP-0009)

• Multi-user conferencing (JEP-0045)

• Service browsing (JEP-0030)

• XHTML message support (JEP-0071)

Compatibility:

The following are servers that are known to work with XIFF and Flash:

Wildfire (http://www.jivesoftware.org/wildfire)
• Jive Messenger (http://www.jivesoftware.org)
• Antepo OPN Server (http://www.antepo.com)
• OpenIM 1.2.1 (http://www.open-im.net/en/)
• JabberD 1.4.3 (http://www.jabber.org)
Jabber, Inc. XCP (http://www.jabber.com)

With the feature and compatibility set, here are some common uses and ideas. 

Possible uses:

• Adding instant messaging to your projects. This includes nifty features like presence information, multi-user conferencing support, XHTML message support, Flex data enabled roster handling and so on.

• Live communication of any kind, including live tech support, admin communication, and anything that requires a live response from an admin side.

•Creative advertising… use your imagination.

• The general ability to be able to “push” content to your visitor, rather than depending on them to “request” it.

This library is currently in alpha. As soon as there has been a bit more testing we will move it to beta and release the source.  Check out a Flex demo of the messenger here.

//nick

velloff.com 

 

 multi-user chat

multi-user chat  

single user chat

personal messaging

xmpp and flash actionscript 3

Friday, September 1st, 2006

I am currently working on a port of the xiff library to AS3. This library was originally coded by Sean Voisen http://www.voisen.org/.
If you want any info about the current library go to http://www.jivesoftware.org. This library is protected by the "GNU LESSER GENERAL PUBLIC LICENSE, thus you will have access to all the source when it is complete. I will be posting a flex demo soon at http://www.velloff.com.

This library can easily be used to built chat clients among other xml socket based communication. It is a cheap alternative to Flash Media Server as there are a number of open source servers out there that support XMPP. Jive Software's Wildfire  supports Flash player's socket nuances right out of the box, and is a breeze to set up.