p2p-chat is a minimal command-line chat program written in Go. One peer starts a listener that waits for an incoming TCP connection, and a second peer connects to it directly — no server, no account, no broker. This guide walks you through installing the prerequisites, starting both sides of the connection, and sending your first message.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Project516/p2p-chat/llms.txt
Use this file to discover all available pages before exploring further.
You need two terminal windows open at the same time: one to run the listener and one to run the connecting peer. Both can be on the same machine, or on two different machines on the same network.
Install Go 1.26.2
p2p-chat requires Go 1.26.2 or later. Check whether you already have it:If the output shows To make the
go1.26.2 or higher, skip to the next step. Otherwise, install Go for your platform:- Linux
- macOS
PATH change permanent, add the export line to your ~/.bashrc or ~/.profile and restart your shell.Start the listener (terminal 1)
In your first terminal, start a listener on Expected output:The process blocks here until the second peer connects.
localhost:5555. This peer waits for an incoming connection.Connect from a second terminal (terminal 2)
Open a second terminal, navigate to the same project directory, and connect to the listener:Expected output:At the same moment, the first terminal prints:Both peers are now live. Anything you type in one terminal appears in the other.
Send a message and set a display name
Type a message in either terminal and press Enter to send it.To set your display name as it appears to the other peer, use the The other peer will see your messages attributed to
/nick command:alice from that point on.Available commands
Once connected, the following slash commands are available in either terminal:| Command | Description |
|---|---|
/nick | Set your display name as seen by the other peer |
/quit | Disconnect and exit the program |
/version | Print the current p2p-chat version |
/help | List all available commands |