Skip to content

A CLI chat application based on p2p connection

Notifications You must be signed in to change notification settings

diyorbek/p2p-chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Peer to peer chat app

A CLI chat application based on p2p connection. The peers eshtablish direct connection and the messages are sent only between them using UDP protocol.

The communication is done via the UDP Hole Punching technique. There is a rendezvous-server which helps peers to exchange their IPs and port numbers. After matching the peers, the server does not participate in the messaging between the peers. The messages are serialized but not encrypted.

Setup

There is a docker configuration for the rendezvous-server for Ubuntu. If you're using Docker then just run this command in ./renderzvous-server folder:

docker-compose up

It installs all the dependencies automatically.

The same configuration can be using for the client application. To manually setup the project, install these dependencies:

CMake - Installation guide.

Boost C++ - Project uses Boost Asio as it has rich API for network communication. Here are the instructions for installing Boost on Windows, Ubuntu and MacOS.

Build

After installing all the dependencies go to the application folder you want to build and run these commands:

cd rendezvous-server # if you want to build the server
cd client # if you want to build the client

mkdir ./build
cmake -B/build -S . -D CMAKE_BUILD_TYPE=Release
cmake --build /build

Needs improvement

  • Message encryption.
  • Send KEEP_ALIVE packets periodically to prevent UDP Hole from closing.
    • Aternatively: Punch a new UDP hole in a specific time interval.

About

A CLI chat application based on p2p connection

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published