/Chat_Box

Chat Box - Client-Server

Primary LanguagePython

Chat Box - Networking final project

Alon Barak

Idan Philosoph

About the project

This project is a Chat Box application based on the Client-Server model.
It allows different users to communicate with each other using a shared Server.
The Protocols we used in this project are TCP and RDT-over-UDP.

How to run the project

In order to run the project on your machine please follow the instructions below:
Please make sure that next packages are installed in your Machine:
tkinter, pip, socket, threading, Path, _thread.

  • How to install tkinter library on Ubunto 20.04:
    sudo apt-get update
    sudo apt install python3-tk
  • How to install pip library on Ubuno 20.04:
    sudo apt update
    sudo apt install python3-pip

About the Client-Server Protocol

In this project we've defined a new Protocol for the Client-Server communication.
Prefix to Keys:
"m:message", "s:sender", "r:recipient", "t:request", "p:response", "q:sequence"

  • Connection to the Server:
    Client: <s:'client_name'><r:server:server_IP><t:'connect'>
    Server: <s:server:server_IP><r:'Client_name'><m:True/False><p:'connect_response'>

  • Disconnection from the Server:
    Client: <s:'client_name'><r:server:server_IP><t:'disconnect'>
    Server: <s:server:server_IP><r:'Client_name'><m:True/False><p:'disconnect_response'>

  • Users List:
    Client: <s:'Client_name'><r:server:server_IP><t:'get_user_list'>
    Server: <s:server_server_IP><r:'Client_name'><m:['user1','user2',...]><p:'user_list>

  • Files List:
    Client: <s:'Client_name'><r:server:server_IP><t:'get_file'>
    Server: <s:server: server_IP><r:'Client_name'><m:['file1','file2',...]><p:'file_list'>

  • Broadcast Message:
    Client: <s:'Client_name'><r:'all'><t:'message_request'><m:'message info'>
    Server: <s:server:server_IP><r:'Client_name'><m:True/False><p:'messagee_response'>

  • Private Message:
    Client: <s:'Client_name'><r:'Client2_name'><t:'message_request'><m:'message info'>
    Server: <s:server:server_IP><r:'Client_name'><m:True/False><p:'messagee_response'>

  • Messgae Received:
    Server: <s:'sender_name'><r:receiver_name'><m:'message info'><p:'message_received'>

  • Download a file:
    Client: <s:'Client_name'><r:server:server_IP><t:'download'><m:'file name'>
    Server: <s:server:server_IP><r:'Client_name'><m:'Port number'/'ERR'><p:'download_response'>

    About the Graphic User Interface

    How start up the Server

    • Open the Project folder and run the next command in the command line:
      python src/server/server_main.py
      server_setup
    • Press the option you wish to run and the Server will be up and running

      server_setup_IP

    How to start up a Client and connect to the Server

    • Open the Project folder and run the next command in the command line:
      python src/client/client_main.py
      client_setup
    • Login to the Server using the Server IP address and your Name
      client_Login

    Show Online list

    • Press the Show Online button

    Show Files list

    • Press the Show server files Button

    Send Broadcast message

    • Write your message in the message input box.
    • press send when done.

    Send Private message

    • Write your message in the message input box.
    • Write the name of the User you want to send the message to in the Send to input box.
    • Press send when done.

    DownLoad a File from the Server

    • Write the name of the file you wish to download in the Servere file name input box.
    • Write a name for the file to be saved as in the File name (Client save as) input box.
    • Press Download when done.
    • In a while you will get a messaeg saying the file has been downloaded at 50%.
    • Press Proceed if you wish to countinue with the process.
    • Look up for a message saying the download process finished successfully.

    Update the screen to see messages from others

    • In order to see the messages in the Group Chat please Press the Update screen button.
    • If nothing changes, there are no new messages to present.

    Logout from the Server

    • Press the Logout Button.
    • Wait for the 'Goodbye' message.