gemini/chat-api

A coroutine framework that focuses on hyperspeed and flexible, specifically use for build microservices and middlewares.

Maintainers

Details

github.com/Gemini-D/chat-api

Source

Installs: 0

Dependents: 0

Suggesters: 0

Security: 0

Stars: 25

Watchers: 1

Forks: 22

Type:project

v1.0.1 2021-11-09 09:53 UTC

This package is auto-updated.

Last update: 2024-03-01 00:11:24 UTC


README

本系统支持 NSQ 和 AMQP 两种消费协议,可以通过修改 CONSUMER_ENGINE 环境变量进行切换,推荐使用 AMQP

连接

ws://127.0.0.1:9501/?token=xxx

协议

查看所有用户列表

{"protocal":"user.list","data":"Hello World"}

向对方用户发送消息

{"protocal":"send.message","data":{"id":2,"message":"Hello World."}}

测试

启动两个服务,分别使用端口 9501 和 9502

让客户端A使用以下连接,连接 9501 端口

ws://127.0.0.1:9501/?token=1

让客户端B使用以下连接,连接 9502 端口

ws://127.0.0.1:9502/?token=2

使用客户端 A 发送协议

{"protocal":"send.message","data":{"id":2,"message":"Hello World."}}

客户端 B 即可收到消息