An open API service indexing awesome lists of open source software.

https://github.com/punitkumar4871/p2p_realtime_simulation

This project simulates Peer-to-Peer (P2P) file sharing in real-time using sockets and threading in Python. The main goal is to enable clients to share files directly with each other over a network, without relying on a central server. The project demonstrates efficient file transfer through socket communication, utilizing multithreading to manage m
https://github.com/punitkumar4871/p2p_realtime_simulation

Last synced: about 1 year ago
JSON representation

This project simulates Peer-to-Peer (P2P) file sharing in real-time using sockets and threading in Python. The main goal is to enable clients to share files directly with each other over a network, without relying on a central server. The project demonstrates efficient file transfer through socket communication, utilizing multithreading to manage m

Awesome Lists containing this project

README

          

# P2P Real-time File Sharing Simulation 🖥️📂
---

This project simulates Peer-to-Peer (P2P) file sharing in real-time using sockets and threading. The primary goal of this project is to allow clients to share files with each other efficiently in a peer-to-peer network.

https://github.com/user-attachments/assets/7f3f2614-83f0-400a-b174-aad22ff66bfb

## 🚀 Features
- **P2P File Sharing**:
Share files directly between clients in real-time without relying on a centralized server.

- **Socket Communication**:
Utilizes Python's socket programming to establish a direct connection between peers and transfer files.

- **Multithreading**:
Implements threading to handle multiple file transfers simultaneously, ensuring smooth and efficient data exchange.

- **User Interface**:
Basic command-line interface (CLI) for file sharing initiation and progress.

---

## 📂 Project Structure
```
P2P_realtime_simulation/
├── client.py # Client-side code for connecting and sharing files
├── server.py # Server-side code to initialize the P2P network
├── README.md # Project documentation
├── requirements.txt # Required Python packages
└── assets/ # Folder for additional assets (if applicable)
```

---

## 📦 Installation

1. **Clone the Repository**:
```bash
git clone https://github.com/user-attachments/assets/7f3f2614-83f0-400a-b174-aad22ff66bfb
cd P2P_realtime_simulation
```

2. **Install Dependencies**:
Use the `requirements.txt` to install necessary Python libraries:
```bash
pip install -r requirements.txt
```

3. **Run the Project**:
Start the server and client on separate terminals or machines:
- Run the server:
```bash
python server.py
```
- Run the client:
```bash
python client.py
```

---

## ⚙️ How It Works
- **Client-Server Interaction**:
- The server is responsible for initializing connections and managing peers.
- Clients can connect to the server, search for other clients, and start file sharing through direct socket communication.

- **Multithreading**:
The client-side handles multiple transfers simultaneously using Python's `threading` library, allowing efficient file sharing without blocking other operations.

---

## 🛠️ Technologies Used
- **Python**: Core programming language.
- **Sockets**: For real-time communication between clients.
- **Threading**: To handle multiple simultaneous connections.

---

## 📝 Future Enhancements
- **Graphical User Interface (GUI)**:
Implement a GUI to simplify the user experience and provide better feedback.

- **File Integrity Check**:
Add file integrity checks (e.g., hashing) to ensure files are transferred correctly.

- **Encryption**:
Add security features to encrypt files during transfer for enhanced privacy.

---

## 🤝 Contributions
Contributions are welcome! Feel free to fork the repository, create an issue, or submit a pull request.

---

## 📜 License
This project is open-source and available under the [MIT License](LICENSE).