Skip to content
File

Blob: spec/proto/transport.proto

protobuf51 lines
1syntax = "proto3";
2package protocol;
3 
4option optimize_for = SPEED;
5option go_package = "go.miragespace.co/specter/spec/protocol";
6 
7import "spec/proto/node.proto";
8 
9message Stream {
10 enum Type {
11 UNKNOWN_TYPE = 0;
12 RPC = 1; // used for rpc between nodes and between client/server
13 DIRECT = 2; // used for establishing the reverse proxy from the tunneling node to client
14 PROXY = 3; // used when client is not directly connected to the tunneling node
15 INTERNAL = 4; // used for /_internal endpoint proxying between nodes
16 }
17 
18 Type type = 1;
19 Node target = 2;
20}
21 
22message Datagram {
23 enum Type {
24 UNKNOWN = 0;
25 ALIVE = 1;
26 DATA = 2;
27 RTT_SYN = 3;
28 RTT_ACK = 4;
29 }
30 
31 Type type = 1;
32 bytes data = 2;
33}
34 
35message Connection {
36 enum State {
37 UNKNOWN_STATE = 0;
38 CACHED = 1;
39 FRESH = 2;
40 }
41 enum Direction {
42 UNKNOWN_DIRECTION = 0;
43 INCOMING = 1;
44 OUTGOING = 2;
45 }
46 
47 Node identity = 1;
48 State cache_state = 2;
49 Direction cache_direction = 3;
50 string version = 5;
51}