syntax = "proto3";
package api;
import "google/protobuf/empty.proto";
service User{
rpc Login(LoginBody) returns (LoginReply);
}
message LoginBody {
string token = 1;
}
message LoginReply {
string session_id = 1;
string username = 2;
}
service Tunnel {
rpc Listen(ListenParam) returns (stream ListenNotification);
rpc Transfer(stream TransferBody) returns (stream TransferReply);
}
enum Protocol{
HTTP = 0;
TCP = 1;
// UDP = 2;
}
message ListenParam{
Protocol protocol = 1;
string subdomain = 2;
}
message ListenNotification{
string action = 1;
string message = 2;
}
enum TStatus {
Ready = 0;
Working = 1;
Done = 2;
}
message TransferBody {
string conn_id = 1;
TStatus status = 2;
bytes resp_data = 3;
}
message TransferReply{
string conn_id = 1;
bytes req_data = 2;
}