Ummm... your own IRC server? Seems pretty realtime to me, and quite configurable. Of course, IRC is geared towards group chat, not user-user.<p>Perhaps include some more details about what your restrictions/requirements are - will the users be web-based? How many concurrent users will you expect online at any given time?<p>If you're looking for advice from others, it's best to provide as much info as you can.
I looked into this previously and was interested most by XMPP. You can use open source servers like Openfire (Java, <a href="http://www.igniterealtime.org/projects/openfire/index.jsp" rel="nofollow">http://www.igniterealtime.org/projects/openfire/index.jsp</a>) or eJabberd (Erlang, <a href="http://www.ejabberd.im/" rel="nofollow">http://www.ejabberd.im/</a>). It's more instant messaging than chatting, though (although it does support multi user chat)