client

package
v0.0.0-...-028f1de Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 1, 2024 License: Apache-2.0 Imports: 21 Imported by: 1

Documentation

Index

Constants

View Source
const (
	EXIT                 = "Exit"
	AGENT_TIMEOUT        = "AgentTimeout"
	INIT_CHANNEL_FAILED  = "InitChannelFailed"
	OPEN_CHANNEL_FAILED  = "OpenChannelFailed"
	SESSIONID_DUPLICATED = "SessionIdDuplicated"
	PROCESS_DATA_ERROR   = "ProcessDataError"
	OPEN_PTY_FAILED      = "OpenPtyFailed"
	FLOW_EXCEED_LIMIT    = "FlowExceedLimit"
)

状态码为5时可能的错误码

Variables

This section is empty.

Functions

func NewEscapeProxy

func NewEscapeProxy(r io.Reader, escapeKeys []byte) io.Reader

NewEscapeProxy returns a new TTY proxy reader which wraps the given reader and detects when the specified escape keys are read, in which case the Read method will return an error of type EscapeError.

Types

type Client

type Client struct {
	Dialer *websocket.Dialer
	Conn   *websocket.Conn
	URL    string

	Connected   bool
	Output      io.Writer
	Input       io.ReadCloser
	WriteMutex  *sync.Mutex
	EscapeKeys  []byte
	PortForward bool // true means the client is for portforward

	StreamDataSequenceNumber int64
	// contains filtered or unexported fields
}

func NewClient

func NewClient(inputURL string, input io.ReadCloser, output io.Writer, portForward bool, token string, rawmode bool, verbosemode bool) (*Client, error)

func (*Client) Connect

func (c *Client) Connect() error

Connect tries to dial a websocket server

func (*Client) Loop

func (c *Client) Loop() error

func (*Client) ProcessStatusDataChannel

func (c *Client) ProcessStatusDataChannel(payload []byte) error

func (*Client) SendCloseMessage

func (c *Client) SendCloseMessage() (err error)

func (*Client) SendResizeDataMessage

func (c *Client) SendResizeDataMessage(inputData []byte) (err error)

func (*Client) SendStreamDataMessage

func (c *Client) SendStreamDataMessage(inputData []byte) (err error)

type EscapeError

type EscapeError struct{}

EscapeError is special error which returned by a TTY proxy reader's Read() method in case its detach escape sequence is read.

func (EscapeError) Error

func (EscapeError) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL