GithubHelp home page GithubHelp logo

chat's Introduction

Chat

The goal of this project is to develop a chat service for communication using the TCP/IP and UDP protocols.

One version allows only one client that communicates with another client hosting the server. The other version allows for multiple clients to connect to a non-client server.

The TCP/IP protocol is used for messaging between the client and server. The UDP protocol is used for device discovery, allowing a server to communicate its IP and port to a client without a previously established connection.

Installation

git clone https://github.com/AD1616/chat.git
cd chat
pip install -r requirements.txt

One Client

Start Server

python server.py

Start GUI Client

python gui_client.py

Multiple Clients

Start Server

python multi_server.py

Start GUI Client

python gui_multi_client.py

chat's People

Contributors

ad1616 avatar ellenjxu avatar

Watchers

 avatar

Forkers

ellenjxu

chat's Issues

Chat room

  • Nicknames for each user
  • Use threading on client and server side
  • broadcast messages to all clients
  • Change formatting to add chat room name
  • modifications for encryption

4 hours

Discovering devices

Be able to discover devices on the network.

This solves the issue of having to physically tell a person on the network to chat.

Version 1:

  • Find IPs on the network
  • Attempt to connect to known ports on a chosen IP
  • If it fails, ask for custom port after

Version 2:

  • Use UDP protocol to set up a port on which to broadcast messages
  • Broadcast IP and port on server, and then have client listen on a set port
  • Connect using broadcasted information
  • Check if it actually works across computers (tested locally across two terminals)
  • Change it so it can handle multiple active servers

4 hours

Find IP

  • Need a way to automatically get the non loopback IP

1 hour, solved using netifaces package.

Automatically find open port on router + computer

  • Find open port on router by grep netstat -a
  • Check if that port is open on personal computer
  • If so, bind this to server and let client know to use this port
  • Validate the port isn't in a forbidden list we maintain (try to make it less malicious)

Completed, 3 hours. Utilized subprocess package to do this.

Script to safely kill a process

  • Identify the process currently running on the port and display it
  • Ask user if they want to kill that process
  • Safely kill it

1 hour. Implemented in server.py using subprocess.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.