7,363 open-source and SaaS tools, with GitHub stats refreshed every day.

Gochat

Open source

A lightweight instant messaging system written in Go that supports private messages and room broadcasts over WebSocket and TCP with horizontal scaling.

45.77.108.245
Gochat homepage screenshot
GitHub stars
2.9k
Last commit
1 mo ago
Repository age
6 years
Licence
MIT
Self-hosted
Yes

About Gochat

gochat is a lightweight instant messaging system implemented in pure Go. It supports private messages and room broadcast messages, and its layers communicate through RPC and can be scaled out horizontally. The README is written in Chinese with an English version, and it is aimed at developers who want to learn from or build on an IM backend.

Clients can connect over WebSocket or TCP, and messages sent over one are delivered to the other. Components discover each other through etcd, which makes it easier to add servers when scaling, and Redis is used as the carrier for message storage and delivery, though it could be replaced by heavier brokers such as Kafka or RabbitMQ. The repository includes Docker support for building all environment dependencies in one step and a separate React UI project for a demo front end.

gochat is licensed under MIT and runs on your own infrastructure, with Go 1.18 or newer recommended for building. Documentation covers architecture, service discovery, message delivery, sequence diagrams and a simple load test, along with directory structure and database tables. It suits Go developers exploring distributed chat architecture.

Key features

  • Private messages and room broadcasts
  • WebSocket and TCP connections
  • RPC between layers for horizontal scaling
  • etcd-based service discovery
  • Redis for message delivery
  • Docker one-click environment setup

Good fit for

  • →Learning distributed IM architecture in Go
  • →Prototyping a chat backend
  • →Running a small self-hosted chat service
Built with
Go
Tags
instant-messaging
go
websocket
chat
etcd
redis
distributed
tcp
im-server

Gochat: questions and answers

What is Gochat used for?
Gochat is a lightweight instant messaging system written in Go that supports private messages and room broadcasts over WebSocket and TCP with horizontal scaling. It is a good fit for learning distributed IM architecture in Go, prototyping a chat backend and running a small self-hosted chat service.
Is Gochat open source?
Yes. Gochat is open source under the MIT licence. Its source code is on GitHub at LockGit/gochat and is written mainly in Go.
Is Gochat free?
Yes. Gochat is open source, so the software itself is free to use.
Can I self-host Gochat?
Yes. Gochat can be self-hosted on your own server or infrastructure; there is no official hosted version.
What are some alternatives to Gochat?
Similar open-source tools in the Team Chat category include Stoat, Open OSCAR Server and Teamgram. SaaS products in the same category include Tencent QQ, Kik and Telegram.
Is Gochat actively maintained?
Yes. The most recent commit to Gochat was on 1 September 2026. The project has 2.9k stars on GitHub.

Open-source alternatives to Gochat

See all

SaaS alternatives to Gochat

See all