Skip to content
Takehome - Chat server written in Golang
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
broker.go final touches Jul 20, 2018
config.json All requirements working Jul 20, 2018
main.go final touches Jul 20, 2018

Go chat server

Telnet demo: Curl demo:

Start instructions

To run the chat server:

$ go run *.go

To connect a telnet client:

telnet localhost 3333

To post messages via curl:

curl -d 'username=myFancyUserName&msg=How do you do fellow kids?' 'http://localhost:3000/post'

To check messages history via curl:

curl 'http://localhost:3000/messages'


There aren't any bugs I'm aware of. There is currently only 1 big chatroom. I'm using channels to broadcast messages between all the connected clients. After you connect via telnet you can type /help to se what commands are available.

All chat messages are saved to ./messages.log.

Given more time, I would add tests, add proper error conditions, and ensure I'm closing the channels and connections properly. Following that, I'd start testing scale, and see how the server scales before optimizing.

You can’t perform that action at this time.