Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
G

go-chat

> 编程语言
Open source

Golang 高并发聊天程序/go chat room

348 stars0 likes1 views
WebsiteGitHub

About

Golang 高并发聊天程序/go chat room

项目简介

这是使用 Golang 网络编程实现的一个多人在线聊天系统,使用 goroutine 达到高并发的效果,使用 redis 来保存用户的注册信息。 项目目录结构如下:

…

服务端和客户端代码基本独立,server 目录下是服务端代码,client 目录下是客户端代码,common 目录下的包由服务端和客户端共同使用

本地运行本项目(Unix 系统下)

下载项目

下载到本地的 GOPATH 目录下(后面会提供 go get 的方式以方便使用),由于这是 Golang 项目,所以需要你本地有 Golang 的运行环境

bash
cd ${GOPATH}/src
git clone [email protected]:ItsWewin/go-chat.git

编译和运行

编译并运行服务端代码

go build -o server gochat/server/main
./server

编译并运行客户端代码

go build -o client gochat/client
./client

这样就大功告成,你就可以在本地体验本项目了。

项目概况

项目目前实现了如下功能

  1. 用户注册、登陆
  2. 显示所有在线用户列表
  3. 发送群消息(目前是发送给在线的所有用户)
  4. 私聊某一个用户
  5. 按照消息的类型(info, notice, warn, error, success) 使用不同的颜色打印消息(Unix 和 window 均支持)

项目效果图

注册

登陆

显示在线用户列表

群聊

私聊


English

chat room

The chat room developed by Golang, It's a good project to learn Golang and Golang netWork developemt

usage

clone this project to your GOPATH

bash
cd ${GOPATH}/src
git clone [email protected]:ItsWewin/go-chat.git

build server and run it

go build -o server gochat/server/main
./server

build client and run it

go build -o client gochat/client
./client

Function of this demo

  1. User register
  2. User login
  3. User send group message
  4. Show online user list
  5. Point-to-point communication

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Go

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言