session

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: 5 Imported by: 0

Documentation

Overview

Package session defines an SSH Relay protocol implementation.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrBadProtocolVersion is returned when a bad protocol version is requested.
	ErrBadProtocolVersion = errors.New("bad protocol version")
)

Functions

func SetDeadline

func SetDeadline(s Session, t time.Duration)

SetDeadline sets a maximum session deadline, after which the session will be terminated.

Types

type ProtocolVersion

type ProtocolVersion int

ProtocolVersion is the version of the SSH relay protocol to use in a session.

const (
	// CorpRelay is the original corp-relay@google.com protocol version.
	CorpRelay ProtocolVersion = iota

	// CorpRelayV4 is the corp-relay-v4@google.com protocol version.
	CorpRelayV4

	// SSHFE is the ssh-fe@google.com protocol version.
	// NOTE: Not implemented.
	SSHFE
)

func (ProtocolVersion) String

func (v ProtocolVersion) String() string

type Role

type Role int

Role indicates the role within a session.

const (
	// Server indicates that this is the server side of a session.
	Server Role = iota

	// Client indicates that this is the client side of a session.
	Client
)

type Session

type Session interface {
	// String returns the Session ID as a string, used for logging.
	String() string

	// SID returns the Session ID.
	SID() uuid.UUID

	// Version returns the protocol version in use for the session.
	Version() ProtocolVersion

	// Run starts bidirectional communication between the client and server.
	Run(ws *websocket.Conn) error

	// Close closes the SSH connection, causing the Session to be invalid.
	Close() error

	// Done notifies when the Session has terminated.
	Done() <-chan struct{}
}

A Session handles SSH-over-WebSocket Relay sessions.

Directories

Path Synopsis
Package corprelay implements the corp-relay@google.com protocol, see https://chromium.googlesource.com/apps/libapps/+/HEAD/nassh/doc/relay-protocol.md#corp-relay.
Package corprelay implements the corp-relay@google.com protocol, see https://chromium.googlesource.com/apps/libapps/+/HEAD/nassh/doc/relay-protocol.md#corp-relay.
Package corprelayv4 implements the corp-relay-v4@google.com protocol, see https://chromium.googlesource.com/apps/libapps/+/HEAD/nassh/doc/relay-protocol.md#corp-relay-v4.
Package corprelayv4 implements the corp-relay-v4@google.com protocol, see https://chromium.googlesource.com/apps/libapps/+/HEAD/nassh/doc/relay-protocol.md#corp-relay-v4.
command
Package command defines the various corp-relay-v4@google.com commands.
Package command defines the various corp-relay-v4@google.com commands.

Jump to

Keyboard shortcuts

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