DISKTREE.NET // PANZERKUNST

Avatar

HXMPP 0.4.2 released

..available on haxelib and head of git.

Main changes:

  • API change! The ‘Stream’ class takes only one parameter now, a ‘Connection’ object … the JID of your account gets now passed into the Stream.open method.
  • Server components require ‘JABBER_COMPONENT’ compiler flag
  • TLS flash socketbridge for (browser) javascript
  • TLS support for nodejs
  • Dirty hacks for flash to be compatible with haXe 2.06 (issue172)
  • Added a terminal tool to register client accounts by hand
  • fixes and minor improvements

I’ve also created a repo at github to collect example usages and tests.
http://github.com/tong/hxmpp.examples

Open source updates

HXMPP updates
* Full adobe air2 support (including native, secure air2 socket connections).
* Added support for websocket connections (javascript only)
* Minor fixes

HXMPP.lop test implementation
The LOP stuff is in the HXMPP repo since months, this is just an example usage.
The application consists of a javascript villein (a anonymous XMPP client) living in the browser and a farm running on the nekoVM. The villein spawns hscript virtual machines on the farm, sends some script .. the farm computes it and sends back the result. Variables live as long until the VM gets killed by the villein.

OWL
A XMPP server running on nodejs.
The project is in a very early state but already doing basic internal instant messaging (no S2S). I am f* enjoying the development process, since i got a good overview on the XMPP protocol over the last couple of years (time goes by in ludicrous speed) while developing the client library and don’t have to read XMPP specs that much .. straight forward coding .. this will change when i get to the S2S stuff. brrr.
Of course written in haXe using the nodejs type signatures from blackdog and (currently) a redis backend.
This project accepts and encourages contributions!
Ping me: xmpp://tong@jabber.spektral.at

Tsunami
A small framework for navigating on websites without reloading using #s (hashes). This is forked from the serverside mtwin templo library.
Here is an example (src).
What sux is that webkit based browser destroy pending XHR requests on hash tag URL changes therefore it breaks BOSH connections -> fail! Firefox does it right.

ROAR 1000+

ROAR, our public, XMPP powered media micro blog, broke the 1000th post barrier some days ago. My plan was to write a new version before that, but busy as (n)ever ..

The XMPP roboter seems to be pretty stable .. didn’t get down since months.
.. runs on nekoVM using a sqlite database.

You can add roar@jabber.spektral.at to your roster to post non-anonymously and directly from you jabber client. The bot accepts your presence subscription automagically. To post simply send a chat message .. your input gets interpreted line by line (most jabber clients can create new lines by hitting ctrl+enter).

Currently following input is supported:

  • Image links (URL has to end with .png, .jpg or .gif)
  • YouTube videos (simply copy URL from the browser bar)
  • Vimeo videos (simply copy URL from the browser bar)
  • Ogg audio files ( .ogg -> html5 audio tag)
  • Ogv video files ( .ogv -> html5 video tag)
  • and of course http links which get a-hrefd

http://roar.disktree.net

Open source updates

  • HXRTP - ORTP bindings for the nekoVM
    Allows you to stream timecoded data using UDP (just single streams right now). Implemented this to toy with jingle-RTP in the future.

ROAR version 7

A new version of ROAR, our public microblogging web app is now online.
Its a complete haXe/javascript rewrite using BOSH (no SWF bridge for the socket connection anymore).

Enjoy, http://roar.disktree.net

haXe/XMPP remoting

I have added a (async) haXe remoting remix to the HXMPP library using XMPP as transport, and created following example to test it:
[ HXR flash example ]

The app:
* embeds the same SWF twice in a HTML site
* the SWF logs into the jabber server with passed account information using SASL-MD5 authentication (password is hidden)
* creates an instance of the application
* create a haXe remoting host in context of the instance to listen for incoming calls.
* create a haXe remoting proxy in context of the instance for outgoing calls.
* on button click:
** creates random values for the next circle to add to the other entities canvas
** adds a circle to the remote entities canvas by calling a function on the proxy

A great benefit of HXR (haXe-remoting) over XMPP is that EVERY entitiy/target, also clients, can act as remote host. Which means i can call methods on a client from any other entity (a server or another client). Pretty cool for round based games and stuff.

Important thing missing is a access model for the remote host.
Currently every entity is allowed to call methods.
(Workaround would be be to add a IQ/HXR filter to block remaing packet collectors)

Source code of the app:
http://paste.disktree.net/82

Web based chat for coders

I’ve started to write a web based multiuser chat, intended to get used mainly by developers. Nothing massiv so far. Last feature i’ve just added: syntax highlight code in serveral languages, which might come in handy.

Give it a try

EDIT:
* Make sure your firewall does not block ports 843, 5222.
* User a HTML5/CSS3 enabled browser.

Apache/Openfire BOSH setup

Since HXMPP supports BOSH connections (flash/js) it’s time to write a little setup instruction….
In my (local) case for apache2/openfire 3.6.4 on ubuntu 9.04.
What has to be done is to be able to connect your client to the BOSH adress of your jabber server. Default on openfire is http://localhost:7070/http-bind/

Your apache server doesn’t know about your jabber server, so you have to setup a proxy to forward requests:
http://localhost/jabber/ > http://localhost:7070/http-bind/

Here we go:

#Activate the mod_proxy apache module if required
sudo ln /etc/apache2/mods-available/proxy.load /etc/apache2/mods-enabled

#Add following line to proxy.load for loading the module
LoadModule proxy_http_module /usr/lib/apache2/modules/mod_proxy_http.so

#Add the proxy directive to the host settings in your http.conf
ProxyRequests Off
ProxyPass /jabber http://localhost:7070/http-bind/
ProxyPassReverse /jabber http://localhost:7070/http-bind/
ProxyPass /jabbers http://localhost:7443/http-bind/
ProxyPassReverse /jabbers http://localhost:7443/http-bind/

#Restart apache
sudo /etc/init.d/apache2 restart

Thats it!
Using HXMPP, you can now create a connection by passing in the path in the constructor, like:
var cnx = new BOSHConnection( “myjabberserver.net”, “127.0.0.1/jabber/” );

Push style microblogging

A small project i am lately working on is a microblogging service, utilizing jabber/XMPP to push new messages (sent from a jabber client) to the users browser in realtime without need of page reloading.
It uses anonymous authentication, which allows to consume it without logging into a jabber account.

haXe really unfolds its power for this project since i target 4 different platforms from one language and use the same jabber library clientside and for the commandline bot. Flash for the jabber client, JS for printing html, PHP for delivering HTML and nekoVM for the jabber bot.

Go test it:
http://roar.disktree.net

The site uses the css3 font-face feature, .. a compatible browser is needed to view the site correctly!
(displays nice in firefox3.5 and safari, shitty in opera)

rare spektral server photo

Below is one of the very rare shots of our shitty, energy unfriendly hardware, hosting the public jabber.spektral.at service, taken by zmo at the last crash/reboot some days ago (someone drilled a electric cable, no USV!).
( computer left/below runs the openfire jabber server )

THX to the 0xFF for everything !

WeFeelFine jabber bot

I’ve created a jabber bot for the WeFeelFine API.

Bots presence:

We Feel Fine is an exploration of human emotion on a global scale.
Since August 2005, We Feel Fine has been harvesting human feelings from a large number of weblogs. Every few minutes, the system searches the world’s newly posted blog entries for occurrences of the phrases “I feel” and “I am feeling”. When it finds such a phrase, it records the full sentence, up to the period, and identifies the “feeling” expressed in that sentence (e.g. sad, happy, depressed, etc.)

You can add wefeelfine@jabber.spektral.at to your contact list and request the bot with chat (or normal type) messages like:

returnfield, returnfield,… $ option=value+option=value+…

..where the returnfields specifiy the data which should get loaded (sentence is default).
Possible returnfields are:

  • imageid
  • feeling
  • posttime
  • postdate
  • posturl
  • gender
  • born
  • country
  • state
  • city
  • lat
  • lon
  • conditions

Key-value pairs after ‘$’  specify optional settings, which are:

  • limit=0-1500 (num feelings to return)
  • feeling=a-z (specify feeling)
  • gender=0/1 (0=female,1=male)
  • conditions=1-4 (1=sunny, 2=rainy, 3=snowy, 4=cloudy)
  • counry=a-z
  • state=a-z
  • city=a-z
  • postdate=date (YYYY-MM-DD)
  • postmonth=1-12
  • postyear=0-2009

The bot will return 5 values if no ‘limit’ options is specified.
Type ‘help’, ‘fields’ or ‘options’ to display the possible request fields.

Here are some examples:

“Give me the most recent 5 sentences from vienna”:
$city=vienna

“Give me the last two sentences from people in canada who feel loved”:
$limit=2 + feeling=loved + state=canada

“Give me the last 3 sentences plus city, gender, latitude and longitude from people in paris who feel angry”:
city,gender,lat,lon $ limit=3 + city=paris + feeling = angry

HXMPP Personal Event Protocol

The next new XEP implemented by HXMPP is the Personal Eventing Protocol.

Abstract:
This specification defines semantics for using the XMPP publish-subscribe protocol to broadcast state change events associated with an instant messaging and presence account. This profile of pubsub therefore enables a standard XMPP user account to function as a virtual pubsub service, easing the discovery of syndicated data and event notifications associated with such an account.

You can communicate following information:

  • Tune: Communicate information about music to which a user is listening.
  • Mood: User moods, such as whether a person is currently happy, sad, angy, or annoyed.
  • GeoLocation: Information about the current geographical or physical location.
  • Activity: Extended presence data about user activities.

HXMPP Publish Subscribe

Today i’ve added PubSub support to our HXMPP library.
Pubsub is a notification system like web syndication (RSS, Atom, ..) for the XMPP protocol with some great advantages:

* Realtime. Unlike regular web syndication, pubsub is a pushing system.
As soon as a new item is published at a node, the service notifies all registered subscribers. This is the last hurdle (in terms of time) evolution of global information technology is overcoming by delivering information for human unrecognizeable delays (millisecondes). Unlike rss, email,.. more like global smoke signals. )

* Bandwith. New information is pushed only once.
Assume you have 50 feeds on your watchlist and every feed is about 10k in size and gets polled every 30 mins (the default configuration time in my RSS-reader), .. you end up having 1mb polled in 1h (720mb/month) mostly for /dev/null space since a lot of feeds just update in day intervals. This produces unecassery cost$ if you don’t have a flatrate connection (keyword mobile). Not to mention the extra costs for network transfer at servers (and power consumption)!

* Configuration is built into the service itself, not in the software you use for.
Publishers are able to config their service to their needs (like: manage subscription requests, cache items, not routing events to offline storage, block users,..).
Subscribers can config their subscriptions, for example: to get just the title of the published data (bandwith again!) or to set the presence types which are allowed to receive notifications.

Overall the current system (RSS stuff) is doing it completely wrong and hopefully gets dropped and replaced by pubsub like systems very soon!

HXMPP SWC

The latest haXe release (2.03) includes experimental support for flash9 SWC output. Which means you now can use our HXMPP library from actionscript3 without loosing haXe compiler performances improvements. Before this was only possible by generating as3 code which was a bit tricky sometimes.

Download the current HXMPP-SWC from the link below if you are a AS3 developer who dont wants to get hands dirty with the haXe stuff (you propably should). The SWC only includes jabber-client related classes (as HXMPP also supports creating server components ).
Usage is straightforward. Here is an example.

[ HXMPP 0.3.1 SWC ]
[ API documentation ]

Please report detected bugs concerning SWC to the haXe mailing list or HXMPP related things to the the issue tracker.

pasteboard upgrade

I’ve upgraded our pasteboard application. Beside a rewrite of the web front and server code i’ve added functionality to paste via jabber ( built with HXMPP targeting nekoVM ):

How to normal type message paste:
Type your language name into the subject.
Type your code into the body.

How to chat type message paste (in case your client does not support ‘normal’ type messages, like pidgin or the gtalk web widget ):
Send: language$$$code

Mind: The account has to be in your roster (accepts all presence subscriptions automaticly). On success the bot responds with message including the URL to your fresh, syntax highlighted paste. If the language is unkown your input gets filed under plaintext.

The used codehighlighter script by Joakim Ahnfelt also got an update and now supports: html, xml, javascript, php, css, perl, ruby, c, c++, c#, java, scala, haxe, python, haskell, latex, plus a few obscure languages.

[ paste.disktree.net ]

HXMPP example - account registration

Based on HXMPP i’ve created a simple example of a web based jabber account registration form. Intention for this is to get used on any user registration where an (additional) jabber account should get created too. The application compiles seamlessly to flash9+ and javascript (flash plugin required for the socket connection) and got tested against openfire and ejabberd.

Note: UI is pretty rough, just for testing purposes.
Note: A list of free jabber services.
Note: Use firebug to show the transfered XMPP.

[ view haXe source code ]
[ download haXe source code ]

BTW: HXMPP 0.3 got released some days ago and is available at code.google.

Next,

Twitter



haXe

Get Linux



Spread Firefox Affiliate Button

CNXS game