Delphi has been shipped with Indy for several years as part of the initial installation. If you go to the Indy download page (linked), you will find a link to several demo applications, one of which is a chat demo.
You did not specify which version of Delphi you are using, so the demos may or may not need minor changes. If you cannot understand them, you can post specific questions about the problems here (if they are no longer there).
Edit: It seems they have refused to demonstrate the chat in recent versions. There's a full chat application (with code) on Delphi.About that can help (along with a few other Indy demos and articles).
Ken white
source share