數據經過Socket通訊,主要以Json格式數據爲主。瀏覽器
在數據的開頭,有2個分別以64bit的無符號整型<message length><message payload>
表示數據的長度和負載。服務器
數據格式:session
type Auth struct { Version string // protocol version MmVersion string // major/minor software version (informational only) User string Password string OS string Arch string ClientId string // empty for new sessions }
AuthResp併發
type AuthResp struct { Version string MmVersion string ClientId string Error string }
ReqTunneldom
type ReqTunnel struct { ReqId string Protocol string // http only Hostname string Subdomain string HttpAuth string // tcp only RemotePort uint16 }
NewTunneltcp
type NewTunnel struct { ReqId string Url string Protocol string Error string }
ReqProxyui
type ReqProxy struct { }
RegProxythis
type RegProxy struct { ClientId string }
StartProxycode
type StartProxy struct { Url string // URL of the tunnel this connection connection is being proxied for ClientAddr string // Network address of the client initiating the connection to the tunnel }
Pingorm
type Ping struct { }
Pong
type Pong struct { }