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) error
- func (cc *Client) SetAuthAgent(_agent agent.ExtendedAgent)
- func (cc *Client) Shell() error
- type Conf
- type Dialer
- 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
func (*Client) SetAuthAgent ¶
func (cc *Client) SetAuthAgent(_agent agent.ExtendedAgent)
SetAuthAgent set auth agent
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
type Dialer ¶
type Dialer struct {
// NetDial specifies the dial function for creating TCP connections. If
// NetDial is nil, net.Dial is used.
NetDial func(network, addr string) (net.Conn, error)
Proxy func() (*url.URL, error)
// TLSClientConfig specifies the TLS configuration to use with tls.Client.
// If nil, the default configuration is used.
// If either NetDialTLS or NetDialTLSContext are set, Dial assumes the TLS handshake
// is done there and TLSClientConfig is ignored.
TLSClientConfig *tls.Config
NetConf *Conf
}
func (*Dialer) DialContext ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.