Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wecloud_im_server
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hewei
wecloud_im_server
Commits
758340b9
Commit
758340b9
authored
Oct 09, 2021
by
giaogiao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加websocket文档
parent
e56d9faf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
7 deletions
+16
-7
config/src/main/resources/static/Wecloud-IM-Websocket-Docs.html
+0
-0
docs/md/wecloud-im前端Websocket对接文档.md
+16
-7
No files found.
config/src/main/resources/static/Wecloud-IM-Websocket-Docs.html
View file @
758340b9
This source diff could not be displayed because it is too large. You can
view the blob
instead.
docs/md/wecloud-im前端Websocket对接文档.md
View file @
758340b9
# wec
loud-im 前端Websocket对接文档
# wec
loud-im 前端Websocket对接文档
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
## 文档描述
## 文档描述
本项目有两个文档
, 1.
websocket对接文档 和 HTTP协议的API文档
本项目有两个文档
:
websocket对接文档 和 HTTP协议的API文档
**本文档为websocket技术对接文档**
**本文档为websocket技术对接文档**
...
@@ -96,7 +96,8 @@ _______
...
@@ -96,7 +96,8 @@ _______
要使用即时通讯服务,每一个终端设备需要首先建立与即时通讯云端的 WebSocket 长连接,并使用唯一的
`clientId`
来加入即时通讯服务,我们把这一过程称为「登录」。请注意这里的登录仅仅指客户端登录即时通讯服务,与应用层面的用户账户注册登录是不一样的。
要使用即时通讯服务,每一个终端设备需要首先建立与即时通讯云端的 WebSocket 长连接,并使用唯一的
`clientId`
来加入即时通讯服务,我们把这一过程称为「登录」。请注意这里的登录仅仅指客户端登录即时通讯服务,与应用层面的用户账户注册登录是不一样的。
### appKey与appSecret
### appKey与appSecret
为im云下发给接入方安全保护密钥,不建议保存在接入方前端客户端, appKey与appSecret总是成对出现和使用
appKey为应用在蔚可云的唯一标识, appSecret为安全密钥, 均由蔚可云控制台或联系客服下发,给应用接入方安全验证密钥,生产环境appSecret不建议保存在接入方前端客户端, appKey与appSecret总是成对出现和使用
### sign签名
### sign签名
...
@@ -120,14 +121,13 @@ clientId:由后端生成
...
@@ -120,14 +121,13 @@ clientId:由后端生成


1.
appKey, appSecret为
im
云下发给客户方安全保护密钥,不建议保存在前端客户端;
1.
appKey, appSecret为
蔚可
云下发给客户方安全保护密钥,不建议保存在前端客户端;
2.
第三方应用服务端需提供获取sign的接口, sign 由MD5{timestamp + clientId + appKey + appSecret},其中clientId由后端生成;
2.
第三方应用服务端需提供获取sign的接口, sign 由MD5{timestamp + clientId + appKey + appSecret},其中clientId由后端生成;
3.
前端拿到sign后,调用验证sign接口进行获取token;
3.
前端拿到sign后,调用验证sign接口进行获取token;
4.
websocket连接初始化需要带上token即可连接成功;
4.
websocket连接初始化需要带上token即可连接成功;
### 第三方应用后端生成sign接口示例
### 第三方应用后端生成sign接口示例
**java**
示例代码 ,供客户应用后端参考
**java**
示例代码 ,供客户应用后端参考
...
@@ -159,16 +159,25 @@ public static void main(String[] args) {
...
@@ -159,16 +159,25 @@ public static void main(String[] args) {
### 连接WebSocket
### 连接WebSocket
ws://localhost:8899/ws?token=xxxxxx
ws://localhost:8899/ws?token=xxxxxx
&platform=1
示例:
示例:
```
```
ws://localhost:8899/ws?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiJ3ZWIiLCJjbGllbnRJZCI6ImhhaGFoXzMwIiwiaXNzIjoid2VjbG91ZF9pbSIsImFwcEtleSI6ImVsTHdwZWwxZ1dDSERxWnkiLCJleHAiOjE2MjkwOTY0MzksImlhdCI6MTYyMDQ1NjQzOSwianRpIjoiNDA1YzE3MWM2Njc5NGJmMDllNGRjZDdhNzA0ZjY3YTgifQ.7g2J_0q9UnuWszpuapSJUXJEwVevvI8Rm2Srg3594Lk
ws://localhost:8899/ws?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiJ3ZWIiLCJjbGllbnRJZCI6ImhhaGFoXzMwIiwiaXNzIjoid2VjbG91ZF9pbSIsImFwcEtleSI6ImVsTHdwZWwxZ1dDSERxWnkiLCJleHAiOjE2MjkwOTY0MzksImlhdCI6MTYyMDQ1NjQzOSwianRpIjoiNDA1YzE3MWM2Njc5NGJmMDllNGRjZDdhNzA0ZjY3YTgifQ.7g2J_0q9UnuWszpuapSJUXJEwVevvI8Rm2Srg3594Lk
&platform=1
```
```
#### 请求参数
| 字段名 | 字段类型 | 是否可空 | 说明 |
| -------- | -------- | -------- | ------------------------------------- |
| token | String | 否 | token |
| platform | int | 是 | 设备平台类型: 1 安卓; 2 ios; 3 web |
## 请求CMD指令说明
## 请求CMD指令说明
-
1: 发送消息
-
1: 发送消息
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment