VoChat.com is a stream-chat engine that can be loaded on chat servers
Title
Voc project
Description
What is the common way to introduce such functionality? Webmasters make cgi-script (PHP-script, jsp-srcpt, e.t.c) which checks for new messages every second (2,3...) and prints something to the client. Of course, you need one instance of the script for each client.
Now calculate how many data-requests you need to process every second... At least two for each client -- get messages, get users-list.
Also don't forget about memory and CPU usage. For instance, if you have PHP-scripts and PHP is compiled as an Apache-module, be ready to spend 5 Mbytes of memory and 0.1-1% of CPU for each client (only for messages-window)