Chat server is written in Haxe and uses Neko VM. It is basically a continuous upgrade of Haxe default chat-server example.
Chat client uses flash programmed in Haxe that passes data to Javascript which then enables real-time "in-the-page" HTML chat experience without http polling.
Server, Flash Client and JS Client communicate via Haxe remoting so a biggest deal of gratitude should go to Haxe/Neko maker Nicolas.
Itmchat does some stuff to remain a viable chat experience when you move (or reload) across multiple pages of chat enabled website.
Auto-join-on-reload functionality
You can reload the page with chat embedded into it, go to other pages that have the chat embedded and the chat should remain fully functional and enable you to chat while doing so. The important point at this goal was that we should not send any info down the wire multiple times (burden our chat-server) unnecessarily.
The reload functionality works like this, let's say that chat is embedded on some wiki-like page:
- You are on the page and you have an inactive chat on the right side
- You click Join and the chat connects and changes appearance (the JS stores a cookie so that it knows that it's joined)
- You chat and then you click a link to go to another page of wiki
- As the new page loads, chat opens in already active mode, you can see all the chat from the previous page (the client stored messages of previous page into a cookie so this adds no additional load to the server)
- It takes some time for the browser to load a new page so user would not see the messages that were sent during this page loading. That's why every message has a number and client always knows the number of the last message it received. When client makes the auto-join it also sends the number of last message it received and the server sends it a package of messages from the current message to that one.
- This way you can travel, reload, submit web-pages with chat active in the page and no message should get lost.
Itmchat is work in progress!
News and state of things
2.2.2008 v.01
- The chat is in use at one portal for 3 months now.
- It is quite basic in "chat features" (no rooms, private msgs, special commands...)
- Client is rendered as normal XHTML so you can plug it into any page and customize it with CSS, javascript, html quite easily.
- Flash client is connected to chat server to which it passes and receives messages from. Flash then passes messages to some low level JS (jsclient.js) than then calls (itmchat.js) which only holds front-end js stuff (callbacks for server events and functions that call the server). If you want to customize the html front-end you could just change functions in itmchat.js . Our itmchat.js uses MooTools to do front-end stuff.
- Auto-join functionality works
- The original chat connected to the server when the flash was loaded even if you didn't join. Now it only makes connection when you join.
16.3.2008 v.02
- Files are in the svn now
- Bug fixes
- Supports multiple "rooms/places"
- Supports system commands -folks, -all folks, -places, -goto, -where, -where is
- auto-join-on-reload and rooms functionality is not yet totally stable
NOW: Testing and removing bugs. Some load testing will also be necessary soon.