Skip to content

Latest commit

 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Net Cat (TCPChat)

A recreation of the classic nc utility as a multi-client group chat, written in Go with nothing but the standard library. One TCP server, up to 10 simultaneous clients, raw sockets.

Built during my training at Zone01 Rouen.

Features

  • One goroutine per client, shared state guarded by a mutex
  • Login with a unique, non-empty username (greeted by an ASCII gopher)
  • Full chat history replayed to newcomers
  • Every message timestamped [YYYY-MM-DD HH:MM:SS][name]: and broadcast to all connected clients
  • Join and leave announcements
  • Terminal escape codes keep your input line intact when a message arrives mid-typing
  • Every session written to a log file in log/
  • Commands: /rename, /list
  • Admin commands (user admin): /ban, /mute, /unmute

Run

go run . [port]

The port defaults to 8989. Then connect from any terminal:

nc localhost 8989

Project structure

server.go   TCP server, client lifecycle, broadcast
login.go    username prompt and validation
cmd.go      /rename, /list and admin commands

About

TCP group chat in pure Go stdlib: one server, many clients, goroutines and mutexes. Zone01 Rouen project.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages