Versions in this module Expand all Collapse all v1 v1.5.0 Apr 6, 2025 Changes in this version + func Handshake(conn net.Conn, authenticator *auth.Authentication, enableAuth bool) (cipher crypto.SymmetricCipher, authKey auth.AES192Key, err error) + func ReadReq[T any](conn net.Conn, dataLen int, cipher ...crypto.SymmetricCipher) (T, error) + func SendHandshakeResp(conn net.Conn, resp HandshakeResp) error + func SendHeartbeat(conn net.Conn, id string, cipher ...crypto.SymmetricCipher) error + func SendHeartbeatNoResp(conn net.Conn, cipher ...crypto.SymmetricCipher) error + func SendRelayStart(conn net.Conn, cipher ...crypto.SymmetricCipher) error + func SendRespHeadError(conn net.Conn, action Action, msg string, cipher ...crypto.SymmetricCipher) error + func SendRespHeadOKWithMsg(conn net.Conn, action Action, msg string, cipher ...crypto.SymmetricCipher) error + func SendRespHeadOk(conn net.Conn, action Action, cipher ...crypto.SymmetricCipher) error + type Action string + const ActionClose + const ActionConnect + const ActionHeartbeat + const ActionPing + const ActionRelay + type CommonReq struct + ID string + type ConnectionReq struct + type HandshakeReq struct + AuthAAD string + AuthFieldB64 string + EcdhPublicKeyB64 string + SecretKeySelector string + func ReadHandshakeReq(conn net.Conn) (HandshakeReq, error) + type HandshakeResp struct + Code StatusCode + EcdhPublicKeyB64 string + Msg string + type HeartbeatReq struct + NeedResp bool + type RelayReq struct + type ReqHead struct + Action Action + DataLen int + func ReadReqHead(conn net.Conn, cipher crypto.SymmetricCipher) (ReqHead, error) + type RespHead struct + Action Action + Code StatusCode + DataLen int + Msg string + type StatusCode int32 + const StatusAuthFailed + const StatusError + const StatusSuccess