PeerChat is a lightweight, terminal-based peer-to-peer chat application built using WebRTC and Pion. It allows two users to chat directly without a central server.
β
Peer-to-peer communication using WebRTC
β
Secure, serverless chat
β
Simple CLI commands to create and join rooms
β
Works over the terminal
Clone the repository and build the binary:
git clone https://github.com/aminGhafoory/peerchat.git
cd peerchat
go build -o peerchat main.goRun the following command to start a new WebRTC session and generate an Offer SDP:
peerchat newπΉ Copy the SDP Offer and send it to the person who wants to join.
If someone has already started a chat session, use this command and paste their SDP Offer:
peerchat joinπΉ After joining, you will get an Answer SDP. Share this back with the initiator to establish the connection.
- PeerChat requires both users to manually exchange SDP offers/answers.
- This implementation does not include a signaling server. You must share SDPs manually (e.g., via another chat app).
- Future versions might include automatic signaling using WebSockets or QR codes.
Pull requests and improvements are welcome! If you find a bug, please open an issue.
- Go
- Pion WebRTC