yao/tai/tunnel/proto/tunnel.proto
Max 7373b0b6f7 feat(tai): enhance gRPC tunnel functionality and internal host handling
- Introduced ExpandHosts function to parse and expand comma-separated host entries, including special values like "internal" and "localhost".
- Updated gRPC server to utilize the new ExpandHosts function for improved host management.
- Added HostHasInternal function to check for "internal" in host strings, enhancing configuration flexibility.
- Implemented new gRPC endpoints for TaiTunnel registration and forwarding, improving tunnel communication capabilities.
- Refactored authentication logic to include new TaiTunnel endpoints, ensuring proper access control.

Made-with: Cursor
2026-03-12 20:35:17 +08:00

56 lines
1.3 KiB
Protocol Buffer

syntax = "proto3";
package tai.tunnel;
option go_package = "github.com/yaoapp/yao/tai/tunnel/taipb";
service TaiTunnel {
// Control plane: Tai → Yao, register + keepalive + receive commands.
rpc Register(stream TunnelControl) returns (stream TunnelControl);
// Data plane: Tai → Yao, raw TCP forwarding.
rpc Forward(stream ForwardData) returns (stream ForwardData);
}
message TunnelControl {
string type = 1; // "register" / "registered" / "open" / "ping" / "pong"
// Carried on "register" (Tai → Yao)
string node_id = 2;
string machine_id = 3;
string display_name = 4;
string version = 5;
Ports ports = 6;
Capabilities caps = 7;
SystemInfo system = 8;
// Carried on "open" (Yao → Tai)
string channel_id = 10;
int32 target_port = 11;
// Carried on "registered" (Yao → Tai)
string tai_id = 20;
}
message ForwardData {
bytes data = 1;
}
message Ports {
int32 grpc = 1;
int32 http = 2;
int32 vnc = 3;
int32 docker = 4;
int32 k8s = 5;
}
message Capabilities {
bool docker = 1;
bool k8s = 2;
bool host_exec = 3;
}
message SystemInfo {
string os = 1;
string arch = 2;
string hostname = 3;
string shell = 4;
}