terminal

package
v3.7.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ReauthenticationInterval = 5 * time.Minute
	BrowserPingInterval      = 30 * time.Second
)
View Source
var ErrAuthChanged = errors.New("Connection closed: authentication changed or endpoint unavailable.")

Functions

func Handler

func Handler(myAPI *api.API) http.Handler

func ProxyTerminal

func ProxyTerminal(w http.ResponseWriter, r *http.Request, terminal *api.TerminalSettings, proxy *Proxy)

Types

type AuthChecker

type AuthChecker struct {
	Checker  AuthCheckerFunc
	Template *api.TerminalSettings
	StopCh   chan error
	Done     chan struct{}
	Count    int64
}

Regularly checks that authorization is still valid for a terminal, outputting to the stopper when it isn't

func NewAuthChecker

func NewAuthChecker(f AuthCheckerFunc, template *api.TerminalSettings, stopCh chan error) *AuthChecker

func (*AuthChecker) Close

func (c *AuthChecker) Close() error

func (*AuthChecker) Loop

func (c *AuthChecker) Loop(interval time.Duration)

type AuthCheckerFunc

type AuthCheckerFunc func() *api.TerminalSettings

type Connection

type Connection interface {
	UnderlyingConn() net.Conn
	ReadMessage() (int, []byte, error)
	WriteMessage(int, []byte) error
	WriteControl(int, []byte, time.Time) error
}

An abstraction of gorilla's *websocket.Conn

func Wrap

func Wrap(conn Connection, subprotocol string) Connection

type Proxy

type Proxy struct {
	StopCh chan error
}

func NewProxy

func NewProxy(stoppers int) *Proxy

stoppers is the number of goroutines that may attempt to call Stop()

func (*Proxy) Serve

func (p *Proxy) Serve(upstream, downstream Connection, upstreamAddr, downstreamAddr string) error

Jump to

Keyboard shortcuts

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