add http and websocket

This commit is contained in:
xyz
2025-06-10 20:17:39 +08:00
parent 030b5d6101
commit 68cd53a80c
23 changed files with 650 additions and 171 deletions

View File

@ -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
}
*/
*/