https://github.com/chouffe/chat-server
A simple chat server in haskell
https://github.com/chouffe/chat-server
chat haskell server system
Last synced: 8 months ago
JSON representation
A simple chat server in haskell
- Host: GitHub
- URL: https://github.com/chouffe/chat-server
- Owner: Chouffe
- License: bsd-3-clause
- Created: 2017-02-28T05:42:27.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-03T05:41:12.000Z (over 9 years ago)
- Last Synced: 2025-03-14T03:22:35.655Z (over 1 year ago)
- Topics: chat, haskell, server, system
- Language: Haskell
- Size: 21.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# HaskChat
HaskChat is a simple chat server (irc like) written in Haskell.
```
_ _ _ ___ _ _
| || |__ _ __| |__/ __| |_ __ _| |_
| __ / _` (_-< / / (__| ' \/ _` | _|
|_||_\__,_/__/_\_\\___|_||_\__,_|\__|
```
HaskChat supports any number of clients and allows them to join and leave at any time.
It is based on the [Stanford Haskell Class: Functional Systems in Haskell](http://www.scs.stanford.edu/14sp-cs240h/labs/lab2.html)
## Features
- TCP communication between clients and server
- The server listen on `CHAT_SERVER_PORT` ENV variable or `12345` (default port)
- Multiple chatrooms are available
- Logging is turned on server side and logs to stdout
## Commands
- `/chatrooms` displays the list of all chatrooms
- `/help` displays this help menu
- `/join ` joins the chatroom
- `/msg ` sends a private message to client
- `/quit` exits the chat server
- `/who` displays who is in the current chatroom
- `/whoami` displays your clientid
## How to use it
### Run HaskChat Server
#### GHCI
```
stack ghci
:load Server
main
```
### CLI
`stack build && stack exec -- chat-server-exe`
## Connect clients
`telnet localhost `
## TODO
- Add thorough test suite using `QuickCheck` and `Hspec`.
- Add better concurrency with STMs.
- Add a better client readline with `Haskeline`.
- Add more commands (irc commands).
- Allow clients to pick a username.