/gopher

go p2p experiment

Primary LanguageGo

P2P Chat in Go

Learning Golang. kthxbai.

Building

go build ./cmd/p2p

Usage

  1. Run the first peer with the following command:
# ./p2p [-p listen-port] 
go run ./cmd/p2p -p 5000

# after the other peer is running, connect to it
> !c localhost:5001
> !sa hi
  1. Run the second peer in another terminal with the following command:
go run ./cmd/p2p -p 5001
> !c localhost:5000
> !sa hello

Use !h to see the list of available commands.