client

package
v0.0.3-alpha Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2023 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CliProtocol

type CliProtocol struct {
	Client *Client
}

func NewCliProtocol

func NewCliProtocol(cli *Client) *CliProtocol

func (*CliProtocol) ExecCommand

func (c *CliProtocol) ExecCommand(cmdType protocol.CommandType, params [][]byte) ([]byte, error)

func (*CliProtocol) IOLoop

func (c *CliProtocol) IOLoop() error

type Client

type Client struct {
	Hostname string

	Conn *Conn

	Conf *config.CliConf
	// contains filtered or unexported fields
}

func NewClient

func NewClient(conf *config.CliConf) *Client

func (*Client) Close

func (c *Client) Close() error

func (*Client) ConnectToSrv

func (c *Client) ConnectToSrv() error

func (*Client) DryRun

func (c *Client) DryRun() error

func (*Client) Exit

func (c *Client) Exit()

func (*Client) GetExitChan

func (c *Client) GetExitChan() <-chan bool

func (*Client) HandleHttpProxy

func (c *Client) HandleHttpProxy() error

func (*Client) HandleSSHProxy

func (c *Client) HandleSSHProxy() error

begin to handle ssh proxy

func (*Client) IsConnValid

func (c *Client) IsConnValid() bool

func (*Client) Run

func (c *Client) Run() error

type Conn

type Conn struct {
	*net.TCPConn

	Conf *config.CliConf
	// contains filtered or unexported fields
}

func NewConnect

func NewConnect(conn *net.TCPConn) (*Conn, error)

func (*Conn) Close

func (c *Conn) Close() error

func (*Conn) Flush

func (c *Conn) Flush() error

func (*Conn) SendCommand

func (c *Conn) SendCommand()

type HttpProxy

type HttpProxy struct {
	Conf *config.ClientHttpProxyConf

	HttpProxyConn   net.Conn
	ForwardHttpConn net.Conn
	ServIP          string
}

func NewHttpProxy

func NewHttpProxy(servIP string, conf *config.ClientHttpProxyConf) *HttpProxy

func (*HttpProxy) Close

func (h *HttpProxy) Close() error

func (*HttpProxy) ConnForwardHttpSrv

func (h *HttpProxy) ConnForwardHttpSrv() (net.Conn, error)

func (*HttpProxy) ConnRemoteSrv

func (h *HttpProxy) ConnRemoteSrv() error

func (*HttpProxy) DryRun

func (h *HttpProxy) DryRun() error

func (*HttpProxy) InitConn

func (h *HttpProxy) InitConn() error

type Preparer

type Preparer func() error

type SSHProxy

type SSHProxy struct {
	SSHProxyConn net.Conn
	ServIP       string
	Exit         chan struct{}
	// contains filtered or unexported fields
}

func NewSSHProxy

func NewSSHProxy(servIP string, sshConf *config.SSHConf) *SSHProxy

func (*SSHProxy) Close

func (s *SSHProxy) Close() error

func (*SSHProxy) ConnForwardSSHSrv

func (s *SSHProxy) ConnForwardSSHSrv() (net.Conn, error)

func (*SSHProxy) ConnSSHProxy

func (s *SSHProxy) ConnSSHProxy(srvIP string) error

func (*SSHProxy) DryRun

func (s *SSHProxy) DryRun() error

func (*SSHProxy) Handle

func (s *SSHProxy) Handle() error

Jump to

Keyboard shortcuts

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