A simple multithreded chat server in haskell
Go to file
Abhinav Sarkar 69a04ab75e Merge pull request #1 from passy/patch-1
(!! 0) = head
2016-06-30 11:37:02 +05:30
app (!! 0) = head 2016-06-29 11:11:51 +01:00
src/Link Adds comments. 2015-09-10 22:18:49 +05:30
test Adds types and a basic server. 2015-09-09 00:23:47 +05:30
.gitignore Adds types and a basic server. 2015-09-09 00:23:47 +05:30
LICENSE Update LICENSE 2015-09-10 15:58:52 +05:30
README.md Adds links to the funconf presentation things. 2016-06-29 14:28:44 +05:30
Setup.hs Adds types and a basic server. 2015-09-09 00:23:47 +05:30
link.cabal Update link.cabal 2015-09-10 16:00:21 +05:30
stack.yaml Adds types and a basic server. 2015-09-09 00:23:47 +05:30

README.md

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.

Usage

Run server:

$ link <port>

Command to the server over TCP:

$ telnet <host> <port>

Commands sent to the server:

  • LOGIN <username> Login with the username
  • QUIT Quit the server
  • MSG <username> <message> Send a private message to a user
  • JOIN <channel> Join a channel
  • LEAVE <channel> Leave a channel
  • TELL <channel> <message> Send a message to a channel
  • NAMES <channel> Get names of all users in a channel
  • PONG Reply to a ping from the server

Messages from the server:

  • LOGGEDIN <username> Confirmation of a login
  • NAMEINUSE <username> Username is already taken
  • MSG <username> <message> A private message from a user
  • NOSUCHUSER <username> You tried to send a message to a non-existent user
  • JOINED <channel> <username> A user joined the channel you have joined
  • LEFT <channel> <username> A user left the channel you have joined
  • NAMES <channel> <username> <username> ... Names of all users in a channel
  • TELL <channel> <username> <message> A message from a channel you have joined
  • PING A ping from the server. Must be replied with a PONG command or else the server will disconnect you.