Skip to content

Forever-CodingNoob/cn-chatroom

Repository files navigation

CN Socket Programming Project: Online Chatroom

Collaborators: @forvkusa, @YunXiuRZ

Demo (Mandarin Warning)

Installation

  • Generate key pairs for both server and client: make gen-certs
  • Run make client to compile the client, and make server to compile the server.
  • Run solely make all to compile both.
  • As for the parameters used to compile them, please dig into Makefile.

Usage

Server

Execution

  • To execute the server, run:
    ./server <server_port>
    where <server_port> is the port the server should be listening on.

Client

Execution

  • To execute the client, run:
    ./client <server_ip> <server_port>
    where <server_ip> and <server_port> are the IP address (IPv4) and port the server is listening on.

Commands

  • General:
    • register <id> <pw>: register a user with id <id> and password <pw>.
    • login <id> <pw>: log into the user with id <id> and password <pw>.
    • logout: log out
    • list: list online users
    • quit: shutdown the client
  • P2P Chatting:
    • connect <id>: connect to the online user with id <id>. (You should first check the list of online users by the list command :))
    • send dm <id> <msg>: send a direct message (i.e. P2P message) <msg> to the user with id <id>.
  • Group Chatting:
    • join <gid>: join the group of (group) id <gid>; a new group will be created on the server upon request if the group is non-existent.
    • leave <gid>: leave the group of (group) id <gid>.
    • send group <gid> <msg>: send a message <msg> to all members of the group with id gid.

References

  • ChatGPT for the implementation of TLS library (tls.(cpp|h) and tls_registry.(cpp|h)) using OpenSSL, several helper functions (e.g. interrupt_notify(), lookup_peer_from_server(), get_room_mutex(), peer_ip(), is_local_ipv4()), and the Makefile.
  • Our own implementation of thread pool library from SP 2023 HW4, NTU CSIE.

About

haha chatroom goes brrrr

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors