add ssh dialer

This commit is contained in:
ginuerzh
2021-12-18 21:22:36 +08:00
parent 6c1522dace
commit 10bcc59370
15 changed files with 831 additions and 5 deletions

View File

@ -0,0 +1,24 @@
package ssh
import (
"net"
"golang.org/x/crypto/ssh"
)
// a dummy ssh client conn used by client connector
type ClientConn struct {
net.Conn
client *ssh.Client
}
func NewClientConn(conn net.Conn, client *ssh.Client) net.Conn {
return &ClientConn{
Conn: conn,
client: client,
}
}
func (c *ClientConn) Client() *ssh.Client {
return c.client
}