Skip to content
File

Blob: spec/proto/transport.proto

protobuf53 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 CONFIG = 5; // used for shared configuration between authenticated physical Chord peers
17 }
18 
19 Type type = 1;
20 Node target = 2;
21}
22 
23message Datagram {
24 enum Type {
25 UNKNOWN = 0;
26 ALIVE = 1;
27 DATA = 2;
28 RTT_SYN = 3;
29 RTT_ACK = 4;
30 }
31 
32 Type type = 1;
33 bytes data = 2;
34}
35 
36message Connection {
37 enum State {
38 UNKNOWN_STATE = 0;
39 CACHED = 1;
40 FRESH = 2;
41 }
42 enum Direction {
43 UNKNOWN_DIRECTION = 0;
44 INCOMING = 1;
45 OUTGOING = 2;
46 }
47 
48 Node identity = 1;
49 State cache_state = 2;
50 Direction cache_direction = 3;
51 string version = 5;
52}