Documentation
¶
Index ¶
- func DefaultIndex() http.Handler
- func NewProxyHandler() http.Handler
- func ProxyBasicAuth(r *http.Request) (username, password string, ok bool)
- func ReverseProxy(tssn transport.Session) *httputil.ReverseProxy
- func Transport(tssn transport.Session) *http.Transport
- type ExpVarStruct
- type Record
- type Relayer
- type SessionStore
- func (s *SessionStore) Allocate(r *http.Request, root string) (string, string, error)
- func (s *SessionStore) GetSession(k string) (transport.Session, bool)
- func (s *SessionStore) Negotiate(r *http.Request, root string, tssn transport.Session, tstm transport.Stream) (string, error)
- func (s *SessionStore) Ping(tssn transport.Session, tstm transport.Stream)
- func (s *SessionStore) Records() (all []*Record)
- func (s *SessionStore) RecordsHandler(w http.ResponseWriter, r *http.Request)
- func (s *SessionStore) RemoveSession(tssn transport.Session)
- func (s *SessionStore) Scan(tssn transport.Session, tstm transport.Stream)
- func (s *SessionStore) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (s *SessionStore) Upsert(k string, tssn transport.Session, tstm transport.Stream, r *http.Request)
- func (s *SessionStore) Visited(k string)
- type Storage
- type Upgrader
- type WSServer
- type WTServer
- type WebsocketUpgrader
- func (s *WebsocketUpgrader) IsRoot(r *http.Request) (result bool)
- func (s *WebsocketUpgrader) IsUpgrade(r *http.Request) (result bool)
- func (s *WebsocketUpgrader) Root() string
- func (*WebsocketUpgrader) Upgrade(w http.ResponseWriter, r *http.Request) (tssn transport.Session, tstm transport.Stream, err error)
- type WebtransportUpgrader
- func (s *WebtransportUpgrader) IsRoot(r *http.Request) (result bool)
- func (s *WebtransportUpgrader) IsUpgrade(r *http.Request) (result bool)
- func (s *WebtransportUpgrader) Root() string
- func (s *WebtransportUpgrader) Upgrade(w http.ResponseWriter, r *http.Request) (transport.Session, transport.Stream, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultIndex ¶ added in v0.3.4
func NewProxyHandler ¶ added in v0.3.1
func ProxyBasicAuth ¶ added in v0.3.1
func ReverseProxy ¶ added in v0.4.5
func ReverseProxy(tssn transport.Session) *httputil.ReverseProxy
Types ¶
type ExpVarStruct ¶ added in v0.3.1
type ExpVarStruct struct { WebteleportRelayStreamsSpawned *expvar.Int WebteleportRelayStreamsClosed *expvar.Int WebteleportRelaySessionsAccepted *expvar.Int WebteleportRelaySessionsClosed *expvar.Int }
func NewExpVarStruct ¶ added in v0.3.1
func NewExpVarStruct() *ExpVarStruct
type SessionStore ¶ added in v0.3.4
type SessionStore struct { Lock *sync.RWMutex PingInterval time.Duration Verbose bool Record map[string]*Record }
func NewSessionStore ¶ added in v0.3.4
func NewSessionStore() *SessionStore
func (*SessionStore) GetSession ¶ added in v0.4.1
func (s *SessionStore) GetSession(k string) (transport.Session, bool)
func (*SessionStore) Ping ¶ added in v0.3.4
func (s *SessionStore) Ping(tssn transport.Session, tstm transport.Stream)
Ping proactively pings the client to keep the connection alive and to detect if the client has disconnected. If the client has disconnected, the session is removed from the session store.
This function has been found mostly unnecessary since the disconnect is automatically detected by the underlying transport layer and handled by the Scan function. However, it is kept here for completeness.
func (*SessionStore) Records ¶ added in v0.3.4
func (s *SessionStore) Records() (all []*Record)
func (*SessionStore) RecordsHandler ¶ added in v0.3.4
func (s *SessionStore) RecordsHandler(w http.ResponseWriter, r *http.Request)
func (*SessionStore) RemoveSession ¶ added in v0.4.1
func (s *SessionStore) RemoveSession(tssn transport.Session)
func (*SessionStore) Scan ¶ added in v0.3.4
func (s *SessionStore) Scan(tssn transport.Session, tstm transport.Stream)
func (*SessionStore) ServeHTTP ¶ added in v0.3.6
func (s *SessionStore) ServeHTTP(w http.ResponseWriter, r *http.Request)
func (*SessionStore) Visited ¶ added in v0.3.4
func (s *SessionStore) Visited(k string)
type Storage ¶ added in v0.3.4
type Storage interface { // Upsert Upsert(k string, tssn transport.Session, tstm transport.Stream, r *http.Request) // Read GetSession(k string) (transport.Session, bool) Records() []*Record RecordsHandler(w http.ResponseWriter, r *http.Request) // Update Visited(k string) // Remove Session // if session is already removed, subsequent calls will be no-op // NOTE: the signature is not Remove(k string) because the key doesn't // uniquely identify the session. If a new session is created with the same key, // it should not be removed by the previous call RemoveSession(tssn transport.Session) // Rand Allocate(r *http.Request, root string) (key string, hostnamePath string, err error) Negotiate(r *http.Request, root string, tssn transport.Session, tstm transport.Stream) (key string, err error) // Serve http.Handler }
/ transport agnostic CRUD
type WSServer ¶ added in v0.3.4
func NewWSServer ¶ added in v0.3.4
func (*WSServer) ConnectHandler ¶ added in v0.3.4
func (s *WSServer) ConnectHandler(w http.ResponseWriter, r *http.Request)
func (*WSServer) IndexHandler ¶ added in v0.3.4
func (s *WSServer) IndexHandler(w http.ResponseWriter, r *http.Request)
type WTServer ¶ added in v0.3.6
type WTServer struct { HOST string Storage *WebtransportUpgrader PostUpgrade http.Handler }
func NewWTServer ¶ added in v0.3.6
func (*WTServer) ServeHTTP ¶ added in v0.3.6
func (s *WTServer) ServeHTTP(w http.ResponseWriter, r *http.Request)
func (*WTServer) WithPostUpgrade ¶ added in v0.3.11
type WebsocketUpgrader ¶ added in v0.3.4
type WebsocketUpgrader struct {
// contains filtered or unexported fields
}
func (*WebsocketUpgrader) IsRoot ¶ added in v0.3.6
func (s *WebsocketUpgrader) IsRoot(r *http.Request) (result bool)
func (*WebsocketUpgrader) IsUpgrade ¶ added in v0.3.6
func (s *WebsocketUpgrader) IsUpgrade(r *http.Request) (result bool)
func (*WebsocketUpgrader) Root ¶ added in v0.3.6
func (s *WebsocketUpgrader) Root() string
type WebtransportUpgrader ¶ added in v0.3.6
func (*WebtransportUpgrader) IsRoot ¶ added in v0.3.6
func (s *WebtransportUpgrader) IsRoot(r *http.Request) (result bool)
func (*WebtransportUpgrader) IsUpgrade ¶ added in v0.3.6
func (s *WebtransportUpgrader) IsUpgrade(r *http.Request) (result bool)
func (*WebtransportUpgrader) Root ¶ added in v0.3.6
func (s *WebtransportUpgrader) Root() string
Source Files
¶
Click to show internal directories.
Click to hide internal directories.