mirror of
https://github.com/nestriness/nestri.git
synced 2025-12-12 08:45:38 +02:00
Replace json protocol by protobuf generate protobuf files with `bun buf generate` or just `buf generate` - [x] Implement all datatypes with proto files - [x] Map to ts types or use the generated proto types directly with: - [x] web frontend - [x] relay - [x] runner - [ ] final performance test (to be done when CI builds new images) --------- Co-authored-by: DatCaptainHorse <DatCaptainHorse@users.noreply.github.com>
38 lines
703 B
TypeScript
38 lines
703 B
TypeScript
import {LatencyTracker} from "./latency";
|
|
|
|
export interface MessageBase {
|
|
payload_type: string;
|
|
latency?: LatencyTracker;
|
|
}
|
|
|
|
export interface MessageICE extends MessageBase {
|
|
payload_type: "ice";
|
|
candidate: RTCIceCandidateInit;
|
|
}
|
|
|
|
export interface MessageSDP extends MessageBase {
|
|
payload_type: "sdp";
|
|
sdp: RTCSessionDescriptionInit;
|
|
}
|
|
|
|
export enum JoinerType {
|
|
JoinerNode = 0,
|
|
JoinerClient = 1,
|
|
}
|
|
|
|
export interface MessageJoin extends MessageBase {
|
|
payload_type: "join";
|
|
joiner_type: JoinerType;
|
|
}
|
|
|
|
export enum AnswerType {
|
|
AnswerOffline = 0,
|
|
AnswerInUse,
|
|
AnswerOK
|
|
}
|
|
|
|
export interface MessageAnswer extends MessageBase {
|
|
payload_type: "answer";
|
|
answer_type: AnswerType;
|
|
}
|