corprelay

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2020 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package corprelay implements the corp-relay@google.com protocol, see https://chromium.googlesource.com/apps/libapps/+/HEAD/nassh/doc/relay-protocol.md#corp-relay.

Index

Constants

View Source
const (
	// AckByteSize is the size in bytes for READ_ACK/WRITE_ACKs.
	AckByteSize = 4

	// AckErrMask is the bit mask for error ack ranges.
	AckErrMask = 0xff000000

	// ChunkSize is the size in bytes for valid read/write requests.
	ChunkSize = 0xffffff
)

Variables

View Source
var (
	// ErrInvalidAck is returned when an ack has any error bits set.
	ErrInvalidAck = errors.New("invalid ack range")
)

Functions

This section is empty.

Types

type Session

type Session struct {
	// contains filtered or unexported fields
}

A Session is an SSH-over-WebSocket Relay session. One leg of the session is a WebSocket, the other is an io.Reader/io.Writer pair that talks plain SSH.

func New

func New(ssh io.ReadWriteCloser) *Session

New creates a *Session from a plain SSH connection.

func (*Session) Close

func (s *Session) Close() error

Close closes the SSH connection, causing the Session to be invalid.

func (*Session) Done

func (s *Session) Done() <-chan struct{}

Done notifies when a session has terminated.

func (*Session) Run

func (s *Session) Run(ws *websocket.Conn) error

Run starts bidirectional communication between the WebSocket and SSH connections.

func (*Session) SID

func (s *Session) SID() uuid.UUID

SID returns the Session ID.

func (Session) String

func (s Session) String() string

func (*Session) Version

func (s *Session) Version() session.ProtocolVersion

Version returns the protocol version in use for the session.

Jump to

Keyboard shortcuts

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