HaXe library for building XMPP/Jabber clients and components.
Supported platforms: javascript, flash, neko, php, c++, [node], [air]

Source

Version: 0.4.11
Get it from github or haxelib

Documentation


A simple client login (SimpleLogin.hx):
class SimpleLogin {
	
	static function onMessage( m : xmpp.Message ) {
		stream.sendMessage( m.from, "Hello!" ); // send response
	}
	
	static function main() {
		var jid = new jabber.JID( 'romeo@example.com' );
		var cnx = new jabber.SocketConnection( jid.domain );
		var stream = new jabber.client.Stream( cnx );
		stream.onOpen = function(){
			trace( 'XMPP stream opened, proceed with authentication ....' );
			var auth = new jabber.client.Authentication( stream, [
				new jabber.sasl.MD5Mechanism()
			] );
			auth.onSuccess = function() {
				trace( 'Succesfully authenticated as ['+jid+']' );
				new jabber.MessageListener( stream, onMessage ); // listen for incoming messages
				stream.sendPresence(); // send initial presence
			}
			auth.onFail = function( info : String ) {
				trace( 'Failed to authenticate ['+info+']' );
			}
			auth.start( 'mypassword', 'resource' );
		}
		stream.onClose = function(?e){
			trace( 'XMPP stream closed ['+e+']' );
		}
		stream.open( jid );
	}
	
}

// haxe -main SimpleLogin -neko test.n -lib hxmpp -D JABBER_DEBUG -D XMPP_DEBUG

XEPs implemented

License

HXMPP is licensed under MIT

Author/Contact

xmpp/mail: tong.disktree@gmail.com
This project accepts and *encourages contributions! (usage, source, love, money, sex, ...)