manager

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2024 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultSessionManager = &SessionManager{
	HOST:     "<unknown>",
	counter:  0,
	sessions: map[string]Session{},
	ssnstamp: map[string]time.Time{},
	ssn_cntr: map[string]int{},
	slock:    &sync.RWMutex{},
	proxy:    NewProxyHandler(),
}
View Source
var PingInterval = 5 * time.Second

Functions

func AddManagerSession added in v0.2.15

func AddManagerSession(currentSession Session, r *http.Request)

func Index added in v0.2.18

func Index() http.Handler

func IsWebsocketUpgrade added in v0.2.15

func IsWebsocketUpgrade(r *http.Request) (result bool)

func NewProxyHandler added in v0.2.26

func NewProxyHandler() http.Handler

func ProxyBasicAuth added in v0.2.24

func ProxyBasicAuth(r *http.Request) (username, password string, ok bool)

Types

type ExpVarStruct added in v0.2.19

type ExpVarStruct struct {
	WebteleportRelayStreamsSpawned   *expvar.Int
	WebteleportRelayStreamsClosed    *expvar.Int
	WebteleportRelaySessionsAccepted *expvar.Int
	WebteleportRelaySessionsClosed   *expvar.Int
}

func NewExpVarStruct added in v0.2.19

func NewExpVarStruct() *ExpVarStruct

type Record

type Record struct {
	Host      string    `json:"host"`
	CreatedAt time.Time `json:"created_at"`
	Tags      tags.Tags `json:"tags"`
	Visited   int       `json:"visited"`
}

type Session added in v0.2.14

type Session interface {
	InitController(context.Context) error
	GetController() net.Conn
	GetValues() url.Values
	OpenConn(context.Context) (net.Conn, error)
}

func UpgradeWebsocketSession added in v0.2.15

func UpgradeWebsocketSession(w http.ResponseWriter, r *http.Request) (Session, error)

type SessionManager

type SessionManager struct {
	HOST string
	// contains filtered or unexported fields
}

func (*SessionManager) Add

func (sm *SessionManager) Add(k string, ssn Session) error

func (*SessionManager) ApiSessionsHandler

func (sm *SessionManager) ApiSessionsHandler(w http.ResponseWriter, r *http.Request)

func (*SessionManager) ConnectHandler

func (sm *SessionManager) ConnectHandler(w http.ResponseWriter, r *http.Request)

func (*SessionManager) DelSession

func (sm *SessionManager) DelSession(ssn Session)

func (*SessionManager) Get

func (sm *SessionManager) Get(k string) (Session, bool)

func (*SessionManager) IncrementVisit

func (sm *SessionManager) IncrementVisit(k string)

func (*SessionManager) IndexHandler

func (sm *SessionManager) IndexHandler(w http.ResponseWriter, r *http.Request)

func (*SessionManager) Lease

func (sm *SessionManager) Lease(r *http.Request, ssn Session, candidates []string, clobber string) error

func (*SessionManager) Ping

func (sm *SessionManager) Ping(ssn Session)

func (*SessionManager) Scan

func (sm *SessionManager) Scan(ssn Session)

func (*SessionManager) ServeHTTP

func (sm *SessionManager) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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