P2P GRPC Chat Client
Simple Golang implementation of a p2p chat client.
1 - Clone the repo
$ git clone firstname.lastname@example.org:rumsrami/p2pchat-grpc.git
2 - cd into cmd/server and cmd/client and run go build
$ go build .
To run the server
Run multiple servers in different terminal windows with host and peer flags
./server --host <host>:<port> --peer <host>:<port>
$ ./server --host localhost:50050 --peer localhost:50051
To run the client
Run multiple clients in different terminal windows with host flags, client should connect to one of the opened servers from the previous step
./client --host <host>:<port>
$ ./client --host localhost:50050
To start chatting
- Send messages through the client window
- Message will be delivered to the corresponding Server window.
- Server will connect to its peers and then deliver the message to them
- Messages will show in the other Server screens.
- Logs appear in the Server screen along with the chat messages
- If a peer disconnects and comes back, it will be still connected to the previous peers