mirror of
https://gitee.com/Zhaoxin59/my-chat_-client.git
synced 2026-02-14 00:51:48 +08:00
add http and websocket
This commit is contained in:
@ -1,11 +1,39 @@
|
||||
syntax = "proto3";
|
||||
package bite_im;
|
||||
option cc_generic_services = true;
|
||||
|
||||
/*
|
||||
消息推送使用websocket长连接进行
|
||||
websocket长连接转换请求:ws://host:ip/ws
|
||||
长连建立以后,需要客户端给服务器发送一个身份验证信息
|
||||
*/
|
||||
message ClientAuthenticationReq {
|
||||
string request_id = 1;
|
||||
string session_id = 2; // 用于向服务器表明当前长连接客户端的身份
|
||||
string session_id = 2;
|
||||
}
|
||||
message ClientAuthenticationRsp {
|
||||
string request_id = 1;
|
||||
bool success = 2;
|
||||
string errmsg = 3;
|
||||
}
|
||||
|
||||
//通信接口统一采用POST请求实现,正文采用protobuf协议进行组织
|
||||
/*
|
||||
HTTP HEADER:
|
||||
POST /service/xxxxx
|
||||
Content-Type: application/x-protobuf
|
||||
Content-Length: 123
|
||||
|
||||
xxxxxx
|
||||
|
||||
-------------------------------------------------------
|
||||
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: application/x-protobuf
|
||||
Content-Length: 123
|
||||
|
||||
xxxxxxxxxx
|
||||
*/
|
||||
|
||||
|
||||
//在客户端与网关服务器的通信中,使用HTTP协议进行通信
|
||||
// 通信时采用POST请求作为请求方法
|
||||
@ -50,4 +78,4 @@ message ClientAuthenticationReq {
|
||||
语音转文字 /service/speech/recognition
|
||||
}
|
||||
|
||||
*/
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user