yanlobkarev / p2p

Twisted p2p chat tutorial.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

P2P chat tutorial.

Following tutorial demonstrates how to implement peer-to-peer chat messaging. Peers use HolePunching traversal technique on top python twisted framework. To check it out- You need to do following.

Install requirements

sudo apt-get install python-dev
sudo easy_install pip
sudo pip install twisted
git clone https://github.com/yanlobkarev/p2p.git
cd p2p

On the machine behind Full-Cone NAT:

#   Using already pre-deployed version
#   of signal server, do the following
python chat_server.py

On the several machines behind any kind of NAT:

python chat_client.py 9999 # port is optional

Send and receive messages.

Optionally You can deploy signal server by yourself:

python signal_server.py & # runs on 8888 port

And don't forget to adjust common.py:

SIGNAL_SERVER_IP = 'XXX.XXX.XXX.XXX'  #   There should be IP your signal server
SIGNAL_SERVER_PORT = 8888

About

Twisted p2p chat tutorial.


Languages

Language:Python 100.0%