Documentation ¶
Index ¶
- func PipeAndClose(c io.ReadWriteCloser, s io.ReadWriteCloser)
- type Client
- func (cc *Client) AddDynamicForward(local string) error
- func (cc *Client) AddDynamicHTTPForward(addr string) error
- func (cc *Client) AddLocalForward(local, remote string) error
- func (cc *Client) AddRemoteForward(local, remote string) error
- func (cc *Client) Client() *ssh.Client
- func (cc *Client) Close()
- func (cc *Client) Run() error
- func (cc *Client) RunCmd(cmd string) ([]byte, error)
- func (cc *Client) Shell() error
- type Conf
- type Server
- type TimedOutConn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PipeAndClose ¶
func PipeAndClose(c io.ReadWriteCloser, s io.ReadWriteCloser)
PipeAndClose pipe the data between c and s, close both when done
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is ssh client connection
func NewClient ¶
NewClient create a new ssh Client
addr is server address
conf is the client configure
func (*Client) AddDynamicForward ¶
AddDynamicForward add a dynamic port forward
func (*Client) AddDynamicHTTPForward ¶
AddDynamicHTTPForward add a http dynamic forward through
secure channel
func (*Client) AddLocalForward ¶
AddLocalForward add a local to remote port forward
func (*Client) AddRemoteForward ¶
AddRemoteForward add a remote to local port forward
func (*Client) Close ¶
func (cc *Client) Close()
Close close the ssh connection and free all the port forward resources
type Conf ¶
type Conf struct { // Timeout is the socket timeout on read/write Timeout time.Duration // KeepAliveInterval the keep alive interval KeepAliveInterval time.Duration // KeepAliveMax the max times of keep alive error KeepAliveMax int }
Conf keeps the configure of server or client
Source Files ¶
Click to show internal directories.
Click to hide internal directories.