tunnelssh

package
v0.1.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 1, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientSSHSession

type ClientSSHSession struct {
	*SSHSession
	// contains filtered or unexported fields
}

func NewClientSSHSession

func NewClientSSHSession(socket net.Conn, pf portForwardingManager, acceptLocalConn bool, logger *log.Logger) *ClientSSHSession

func (*ClientSSHSession) Close

func (s *ClientSSHSession) Close() error

func (*ClientSSHSession) Connect

func (s *ClientSSHSession) Connect(ctx context.Context) error

func (*ClientSSHSession) NextChannelID

func (s *ClientSSHSession) NextChannelID() uint32

func (*ClientSSHSession) OpenChannel

func (s *ClientSSHSession) OpenChannel(ctx context.Context, channelType string, data []byte) (ssh.Channel, error)

type SSHRequest

type SSHRequest interface {
	Type() string
	Reply(ok bool, payload []byte) error
}

SSHRequest represents an SSH request.

type SSHSession

type SSHSession struct {
	*ssh.Session
	// contains filtered or unexported fields
}

TODO(josebalius): Deprecate SSHSession struct.

func (*SSHSession) Read

func (s *SSHSession) Read(p []byte) (n int, err error)

func (*SSHSession) SendSessionRequest added in v0.0.6

func (s *SSHSession) SendSessionRequest(name string, wantReply bool, payload []byte) (bool, []byte, error)

func (*SSHSession) Write

func (s *SSHSession) Write(p []byte) (n int, err error)

type Session

type Session struct {
	*ssh.Session
	// contains filtered or unexported fields
}

Session is a wrapper around an SSH session designed for communicating with a remote tunnels SSH server. It supports the activation of services via the activator interface.

func NewSession

func NewSession(socket net.Conn) *Session

NewSession creates a new session.

func (*Session) Activate

func (s *Session) Activate(ctx context.Context, a activator) error

Active calls the Activate method on the activator interface and passes the session to it.

func (*Session) AddChannelHandler

func (s *Session) AddChannelHandler(channelType string, handler channelHandlerFunc)

AddChannelHandler adds a handler for a channel type.

func (*Session) AddRequestHandler

func (s *Session) AddRequestHandler(requestType string, handler requestHandlerFunc)

AddRequestHandler adds a handler for a request type.

func (*Session) Connect

func (s *Session) Connect(ctx context.Context) (err error)

Connect connects to the remote tunnel SSH server.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL