Terminal Chat

Terminal Chat

completed
Go Goroutines WebSockets Go-Channels

Project Overview

Go it's a "simple" nice language to work with, specially with web related things because of his great language features like go routines that make simple to manage threads, and his good standard library. So I built a small **terminal-based chat system**. It was an experiment to understand **how to manage WebSocket connections, rooms, and file transfers** — all without external frameworks.

The project consists of two main files:

The goal was to explore Go’s concurrency model (goroutines + channels) in a practical setting — where multiple clients interact in real time.

How It Works

screenshot

When a client connects:

  1. It sends its username to the server.
  2. The server registers the user and assigns them to the default chat room.
  3. Messages are broadcast only to users in the same room.

Users can type commands like:

The server handles all communication through a Hub struct that orchestrates everything via channels.