[JDEV] webclient project

Tijl Houtbeckers thoutbeckers at splendo.com
Fri Jan 3 10:41:17 CST 2003

Mike Shoyher <mike at shoyher.com> wrote on 3-1-2003 17:20:48:
>Hello Richard,
>All the clients I found so far aren't pure web, they use either flash 
>or java to connect to the server. I had an intention to make a
>jabber-based web chat, but things look quite complicated to me.
>The major problem is our beloved statelessness of the HTTP. That means
>the web server must keep all sessions to the jabber server. I don't
>see a good way to do it using mod_perl.
>Probably it would make sense to invent special stateless transport for
>the jabber server. The jabber server keeps sessions anyway so we could
>unburden the client and provide a way for the client to send what it
>wants and fetch the whole backlog of waiting messages.

We've done (on a commercial basis) a Jabber Web Client that only uses 
pure HTML, no Java, Flash whatever. In fact is was cHTML (wich does not 
have any of those things). This was done with Apache/PHP and a Java 
based Jabber Component. For each user when a page is requested through 
PHP the same session-id is passed along. The PHP script then uses a 
socket or pipe to connect to the java component. It can use a very 
simple protocol to do basic things like send log in, send a message, 
change presence, retrieve the contactlist etc. 

When the user wants to logs into Jabber the Java/Jabber component uses 
<route/> tags to log into the jabber server for the client. (sort of 
like JADC2S). All hurther things (messages etc) can be done using these.
 We use a component rather then creating a socket connection for each 
 new user, because this greatly enhances stability and scalability. 

overal this solution preserves the "statelessness" of PHP and Apache, 
and scales pretty well. All jabber specifics are done in Java rather 
than PHP, in fact very little is done here, just layout etc. I suppose 
you could use Perl instead of Java, if the quality of the current Perl 
libraries are good enough. 

It's also possible to host the Apache/PHP part, the Java/Jabber 
component and the Jabber server itself on different servers. With a 
little extra effort it's even possible to cluster these things or set 
them up redundantly (except for jabberd itself, though jabber.com can 
take care of that), all persistant data etc. is stored in jabber, you 
don't need MySQL or anything like it. 

Note however that the current way of creating jabber session useing 
<route/> tags to my understanding does not work anymore in jabber2, but 
something simulair will be / is in place (porting it shouldn't be that 
much of a problem). 

Tijl Houtbeckers
Java/J2ME/GPRS Software Engineer @ Splendo
The Netherlands

More information about the JDev mailing list