A simple TCP chat written in Golang.
It supports room
s so that multiple users can join the same or different chats.
โฏ nc 0.0.0.0 5000
๐ฌ Please, enter your name:
user 2
๐ฌ Type in room number:
xxx
๐ฌ *** A new user "user 2" joined the room "xxx" ***
๐ฌ *** Now in room: user 2, user 1 ***
Hello!
๐ฌ user 2 (127.0.0.1:52604): Hello!
๐ฌ user 1 (127.0.0.1:52603): Hey!
How u doing?
๐ฌ user 2 (127.0.0.1:52604): How u doing?
๐ฌ user 1 (127.0.0.1:52603): Doin good!
^C
โฏ nc 0.0.0.0 5000
๐ฌ Please, enter your name:
user 1
๐ฌ Type in room number:
xxx
๐ฌ *** A new user "user 1" joined the room "xxx" ***
๐ฌ *** Now in room: user 1 ***
๐ฌ *** A new user "user 2" joined the room "xxx" ***
๐ฌ *** Now in room: user 2, user 1 ***
๐ฌ user 2 (127.0.0.1:52604): Hello!
Hey!
๐ฌ user 1 (127.0.0.1:52603): Hey!
๐ฌ user 2 (127.0.0.1:52604): How u doing?
Doin good!
๐ฌ user 1 (127.0.0.1:52603): Doin good!
๐ฌ *** User "user 2" left the room "xxx" ***
^C
Start the server using the following command in the app directory:
go run .
Use nc
to connect to the server using TCP:
nc 0.0.0.0 5000