This project implements a peer-to-peer messaging system where users can register themselves with a central discovery server and communicate with each other directly. It consists of two main components:
-
Peer Implementation: This is the client-side implementation responsible for registering with the server, querying for active peers, sending and receiving messages, and maintaining a local SQLite database for message logging.
-
Discovery Server: This is the central server responsible for managing peer registrations, responding to queries about active peers, and removing inactive peers from the registry.
- Python 3.x
- Run the Discovery Server: Start the discovery server by running
python discovery_server.py. - Run the Peer Client: Start the peer client by running
python peer_client.py. - Register: Enter a username to register with the discovery server.
- Connect to a User: Choose to connect to another registered user by their username and start messaging.
- List Active Users: View a list of active users currently registered with the discovery server.
- Python 3.x
- Start the Server: Run
python discovery_server.pyto start the discovery server. - Inactivity Checker: The server automatically removes inactive peers from the registry after a set interval.
- Messages are logged locally in an SQLite database for each peer.
- Both the peer client and the discovery server should be running simultaneously for the system to function properly.