75 lines
1.6 KiB
Protocol Buffer
75 lines
1.6 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package livekit;
|
|
option go_package = "livekit";
|
|
|
|
|
|
// Room service that can be performed on any node
|
|
service RoomService {
|
|
// TODO: how do we secure room service?
|
|
// should be accessible to only internal servers, not external
|
|
rpc CreateRoom(CreateRoomRequest) returns (RoomInfo);
|
|
rpc GetRoom(GetRoomRequest) returns (RoomInfo);
|
|
rpc DeleteRoom(DeleteRoomRequest) returns (DeleteRoomResponse);
|
|
}
|
|
|
|
message CreateRoomRequest {
|
|
string room_id = 1;
|
|
// number of seconds the room should cleanup after being empty
|
|
uint32 empty_timeout = 2;
|
|
uint32 max_participants = 3;
|
|
}
|
|
|
|
message GetRoomRequest {
|
|
string room_id = 1;
|
|
}
|
|
|
|
message RoomInfo {
|
|
string room_id = 1;
|
|
string node_ip = 2;
|
|
uint32 node_rtc_port = 3;
|
|
int64 creation_time = 4;
|
|
string token = 5;
|
|
}
|
|
|
|
message DeleteRoomRequest {
|
|
string room_id = 1;
|
|
}
|
|
|
|
message DeleteRoomResponse {
|
|
}
|
|
|
|
// RTC methods performed on target node
|
|
service RTCService {
|
|
rpc Join(JoinRequest) returns (JoinResponse);
|
|
|
|
// offer allows client to initiate a RTC session
|
|
rpc Offer(SessionDescription) returns (SessionDescription);
|
|
|
|
// trickle sends more ICE candidates to server
|
|
rpc Trickle(TrickleRequest) returns (TrickleResponse);
|
|
}
|
|
|
|
message JoinRequest {
|
|
string room_id = 1;
|
|
string token = 2;
|
|
string peer_id = 3;
|
|
SessionDescription offer = 4;
|
|
}
|
|
|
|
message JoinResponse {
|
|
SessionDescription answer = 1;
|
|
}
|
|
|
|
message TrickleRequest {
|
|
string candidate = 1;
|
|
}
|
|
|
|
message TrickleResponse {
|
|
}
|
|
|
|
message SessionDescription {
|
|
string type = 1; // "answer" | "offer" | "pranswer" | "rollback"
|
|
bytes sdp = 2;
|
|
}
|