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

goim

> 编程语言
Open source

goim

7.4K stars0 likes1 views
WebsiteGitHub

About

goim

goim v2.0

goim is an im server writen in golang.

Features

  • Light weight
  • High performance
  • Pure Golang
  • Supports single push, multiple push and broadcasting
  • Supports one key to multiple subscribers (Configurable maximum subscribers count)
  • Supports heartbeats (Application heartbeats, TCP, KeepAlive, HTTP long pulling)
  • Supports authentication (Unauthenticated user can't subscribe)
  • Supports multiple protocols (WebSocket,TCP,HTTP)
  • Scalable architecture (Unlimited dynamic job and logic modules)
  • Asynchronous push notification based on Kafka

Architecture

Quick Start

Build

    make build

Run

    make run
    make stop

    // or
    nohup target/logic -conf=target/logic.toml -region=sh -zone=sh001 -deploy.env=dev -weight=10 2>&1 > target/logic.log &
    nohup target/comet -conf=target/comet.toml -region=sh -zone=sh001 -deploy.env=dev -weight=10 -addrs=127.0.0.1 2>&1 > target/logic.log &
    nohup target/job -conf=target/job.toml -region=sh -zone=sh001 -deploy.env=dev 2>&1 > target/logic.log &

Environment

    env:
    export REGION=sh
    export ZONE=sh001
    export DEPLOY_ENV=dev

    supervisor:
    environment=REGION=sh,ZONE=sh001,DEPLOY_ENV=dev

    go flag:
    -region=sh -zone=sh001 deploy.env=dev

Configuration

You can view the comments in target/comet.toml,logic.toml,job.toml to understand the meaning of the config.

Dependencies

Discovery

Kafka

Document

Protocol

English

中文

Examples

Websocket: Websocket Client Demo

Android: Android

iOS: iOS

Benchmark

Benchmark Server

CPU Memory OS Instance
Intel(R) Xeon(R) CPU E5-2630 v2 @ 2.60GHz DDR3 32GB Debian GNU/Linux 8 1

Benchmark Case

  • Online: 1,000,000
  • Duration: 15min
  • Push Speed: 40/s (broadcast room)
  • Push Message: {"test":1}
  • Received calc mode: 1s per times, total 30 times

Benchmark Resource

  • CPU: 2000%~2300%
  • Memory: 14GB
  • GC Pause: 504ms
  • Network: Incoming(450MBit/s), Outgoing(4.39GBit/s)

Benchmark Result

  • Received: 35,900,000/s

中文

English

LICENSE

goim is is distributed under the terms of the MIT License.

Issues· 64 open

View all issuesOpen on GitHub
  • #405

    将go版本升级到最新1.23会不会有影响?

    Updated Nov 7, 2024
  • #403

    建议使用sha256做accesskey的生成

    Updated Jun 13, 2024
  • #262

    kafka,建议换成nats

    Updated May 8, 2024
  • #390

    这么好的项目,感觉好久没更新了。有点可惜啊!!

    Updated Apr 18, 2024
  • #396

    discovery 能把这个服务发现注册换成其他的吗。这个discovery好像早就没维护了。而且除了2.*版本其他也不兼容

    Updated Apr 18, 2024
  • #366

    任意room的一个消息是不是要被广播到所有的comet?

    Updated Jan 10, 2024
  • #401

    看代码遇到困惑的地方,请教下为啥discovery://default/goim.logic 这个地址可以直接 dail

    Updated Nov 6, 2023
  • #355

    消息发送疑问

    Updated Oct 7, 2023
  • #402

    online demo not working

    Updated Sep 20, 2023
  • #391

    明显的逻辑问题,难道没人发现吗?

    Updated Aug 4, 2023

> Tags

Go

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedOct 2, 2026
Category编程语言
PricingOpen source

> Related tools

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