File
Blob: spec/proto/transport.proto
| 1 | syntax = "proto3"; |
| 2 | package protocol; |
| 3 | |
| 4 | option optimize_for = SPEED; |
| 5 | option go_package = "go.miragespace.co/specter/spec/protocol"; |
| 6 | |
| 7 | import "spec/proto/node.proto"; |
| 8 | |
| 9 | message 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 | |
| 22 | message 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 | |
| 35 | message 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 | } |