Documentation ¶
Overview ¶
Package sshutil provides higher-level SSH features built atop the `golang.org/x/crypto/ssh` package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ReverseProxy ¶
type ReverseProxy struct { TargetAddress string TargetClientConfig *ssh.ClientConfig // ErrorLog specifies an optional logger for errors // that occur when attempting to proxy. // If nil, logging is done via the log package's standard logger. ErrorLog *log.Logger }
ReverseProxy is an SSH Handler that takes an incoming request and sends it to another server, proxying the response back to the client.
func NewSingleHostReverseProxy ¶
func NewSingleHostReverseProxy(targetAddr string, clientConfig *ssh.ClientConfig) *ReverseProxy
NewSingleHostReverseProxy constructs a new *ReverseProxy instance.
func (*ReverseProxy) Serve ¶
func (r *ReverseProxy) Serve(ctx context.Context, serverConn *ssh.ServerConn, serverChans <-chan ssh.NewChannel, serverReqs <-chan *ssh.Request) error
Serve executes the reverse proxy between the specified target client and the server connection.
type Router ¶ added in v0.0.5
type Router interface {
Route(context.Context, *ssh.ServerConn) (targetAddr string, client *ssh.ClientConfig, err error)
}
Router routes an SSH server connection to some target SSH endpoint.
Click to show internal directories.
Click to hide internal directories.