syntax = "proto3";

package network;
option go_package="./;network";

message connect_addr {
    string addr = 1;
    uint32 port = 2;
}

message connect_shell {
    string         exec = 1;
    repeated string env = 2;
}

message connect_vnc {
    uint32     fps = 1;
    uint32 quality = 2; // image quality, percent
    bool    cursor = 3; // show cursor
}

message connect_request {
    enum type {
        tcp   = 0; // tcp reverse proxy
        udp   = 1; // udp reverse proxy
        shell = 2; // shell
        vnc   = 3; // vnc
        bench = 4; // benchmark
        code  = 5; // code-server
    }
    string name = 1; // rule name
    type  _type = 2; // rule type
    oneof payload {
        connect_addr   caddr = 10; // for reverse proxy
        connect_shell cshell = 11; // for shell
        connect_vnc     cvnc = 12; // for vnc
    }
}

message connect_response {
    bool     ok = 1;
    string  msg = 2;
}
