This project is an implementation of a simple chat server in OCaml using the Lwt library for asynchronous programming.
- Allows multiple clients to connect simultaneously.
- Clients can send messages to the server, and the server broadcasts those messages to all connected clients.
- When a new client joins, a join message is sent to all currently connected clients.
chatroom-demo.copy.mov
The purpose of this project was to deepen my understanding of Ocaml and functional programming languages after taking a course on it during Spring 2024. I have always wanted to implement my own simple chatroom, and doing it in a functional language seemed like a challenge!
- OCaml
- Lwt
-
Clone the repository
-
Navigate to the project directory
-
Run
dune buildto build -
Run
dune exec serverto spin up the server on port 9000 -
Run
dune exec clientto start up a client. You can start up more than one instance of the client. Just open a new terminal window, or use another machine on the same network! -
To exit a client instance, type
\exitand hit enter. You can also press Control-C. -
To stop the server, press Control-C with the server terminal window in focus.