I am currently building a chat server (meebo style).

The architecture is something like this.

1. [Bitlbee](http://Bitlbee.org) over [libpurple](http://pidgin.im) is on host *B*. Its a trivial server on data center.
2. User communicates with bitlbee via web server (just like meebo) on Host *A*. The backend of this web server maintains chat session. It just translates the user commands to proper bitlbee comamnd and sends back to host *A*.

**The most important part here is that host *A* will be deployed in embedded Linux.**

I have **2 questions**.

1. To keep the chat session persistent I am thinking of using [node.js](/questions/tagged/node.js "show questions tagged 'node.js'"). As its much more easier to create a real time application with persistent connection. But I doubt if its supported in such platform.
2. If I use C instead of node.js (I am not using any web server) I can talk to the irc server at host *A* by *libirc*. But how do I implement all the web server features in C (like session, url/cookie/post data parsing etc) ?

Also if you think my approach is wrong or there is a better approach please tell me how can I improve this architecture?

Note: This is NOT a high volume chat server.