P2P Application with Python
P2P: all users are client and server
- Tries to connect to a PEER (client mode)
- IF connection is successful: listen to PEER (client mode)
- IF connection is unsuccessful: become a server mode
-
Start server mode
-
Wait for a peer to connect (server mode)
-
Send data to peer (server mode)
-
create a Python 3.7 virtualenv
$ virtualenv --python=python3 env-p2p
-
source virtualenv
$ source env-p2p/bin/activate
-
Install dependencies, if any
$ pip install requirements.txt
-
Execute p2p_main
$ python p2p_main.py
- Attempt to connect to a PEER (client mode)
-
-
-
-
- TRYING TO CONNECT
-
-
-
- Starting server mode
-
-
-
-
- SERVER RUNNING
-
-
-
- Receiving data from PEER (client mode)
-
-
-
-
- RECEIVING MESSAGE
-
-
-
Based on https://medium.com/@amannagpal4/how-to-create-your-own-decentralized-file-sharing-service-using-python-2e00005bdc4a https://github.com/Ezi0aaudit0re/P2P-music-sharing