# ws服务端-go **Repository Path**: donknap/w7-im-websocket-push ## Basic Information - **Project Name**: ws服务端-go - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2023-06-27 - **Last Updated**: 2024-01-03 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # im 聊天系统 Ws 服务 ### 启动 bin/rangine server:start -f config.yaml ### 编译 ```shell # osx make build-osx # linux make build # windows make build-windows ``` ### 功能介绍 #### 业务队列 用户于用户上线、下线及消息转发, 监听队列为 PullServerQueue。 ##### 上线消息 ```json { "fd": "userid_roles_source::server_host", "content": { "type": "after_open", "token": "" } } ``` #### 下线消息 ```json { "fd": "userid_roles_source::server_host", "content": { "type": "after_close" } } ``` > server_host 用于区分不同的集群,将来推送消息时,也需要按照 server_host 推送不同的消息队列 #### 消息推送队列 PushServerQueue_server_host ```json rpush PushServerQueue_server_host ''{"fd": "1_user_im.w7.cc::VM-0-10-centos","content": "{\"type\":\"clearSurplus\",\"key\":\"im:im.w7.cc:user:1\",\"user\":{\"source\":\"im.w7.cc\",\"id\":1,\"username\":\"wx\\u51cc\\u4e50\",\"avatar\":\"https:\\\/\\\/avatar.w7.cc\\\/images\\\/avatar\\\/0\\\/412\\\/464.jpg?v=1686277639&imageView2\\\/5\\\/w\\\/100\\\/h\\\/100\\\/format\\\/webp\",\"roles\":\"user\",\"channel\":\"pc\",\"last_active_time\":\"2023-06-09 11:53:41\"}}"}'' ```