A simple mutli-threaded chat server written in Haskell with support for user-to-user private messaging and channels which users can join and chat in.
This project is the accompanying code for the presentation Introduction To Concurrency In Haskell delivered at Functional Conf 2015, Bangalore. Slides for the same are available here.
Run server:
$ link <port>
Command to the server over TCP:
$ telnet <host> <port>
Commands sent to the server:
LOGIN <username>
Login with the usernameQUIT
Quit the serverMSG <username> <message>
Send a private message to a userJOIN <channel>
Join a channelLEAVE <channel>
Leave a channelTELL <channel> <message>
Send a message to a channelNAMES <channel>
Get names of all users in a channelPONG
Reply to a ping from the server
Messages from the server:
LOGGEDIN <username>
Confirmation of a loginNAMEINUSE <username>
Username is already takenMSG <username> <message>
A private message from a userNOSUCHUSER <username>
You tried to send a message to a non-existent userJOINED <channel> <username>
A user joined the channel you have joinedLEFT <channel> <username>
A user left the channel you have joinedNAMES <channel> <username> <username> ...
Names of all users in a channelTELL <channel> <username> <message>
A message from a channel you have joinedPING
A ping from the server. Must be replied with aPONG
command or else the server will disconnect you.