add ssh tunnel
This commit is contained in:
@ -15,10 +15,6 @@ import (
|
||||
"golang.org/x/crypto/ssh"
|
||||
)
|
||||
|
||||
var (
|
||||
ErrSessionDead = errors.New("ssh: session is dead")
|
||||
)
|
||||
|
||||
func init() {
|
||||
registry.RegisterDialer("sshd", NewDialer)
|
||||
}
|
||||
@ -126,7 +122,7 @@ func (d *forwardDialer) Handshake(ctx context.Context, conn net.Conn, options ..
|
||||
}
|
||||
if session.IsClosed() {
|
||||
delete(d.sessions, opts.Addr)
|
||||
return nil, ErrSessionDead
|
||||
return nil, ssh_util.ErrSessionDead
|
||||
}
|
||||
|
||||
return ssh_util.NewClientConn(session.conn, session.client), nil
|
||||
|
Reference in New Issue
Block a user