Documentation ¶
Index ¶
- Variables
- func CloseAfterMaxTime(proxy Proxy, maxSessionTime int)
- func NewIOWrapper(conn Connection) *ioWrapper
- func ProxyFileDescriptor(w http.ResponseWriter, r *http.Request, fd *os.File, ...)
- func ProxyWebSocket(w http.ResponseWriter, r *http.Request, terminal *TerminalSettings, ...)
- type Connection
- type FileDescriptorProxy
- type Proxy
- type TerminalSettings
- func (t *TerminalSettings) Clone() *TerminalSettings
- func (t *TerminalSettings) Dial() (*websocket.Conn, *http.Response, error)
- func (t *TerminalSettings) Dialer() *websocket.Dialer
- func (t *TerminalSettings) IsEqual(other *TerminalSettings) bool
- func (t *TerminalSettings) URL() (*url.URL, error)
- func (t *TerminalSettings) Validate() error
- type WebSocketProxy
Constants ¶
This section is empty.
Variables ¶
View Source
var (
BrowserPingInterval = 30 * time.Second
)
Functions ¶
func CloseAfterMaxTime ¶
func NewIOWrapper ¶
func NewIOWrapper(conn Connection) *ioWrapper
func ProxyFileDescriptor ¶
func ProxyFileDescriptor(w http.ResponseWriter, r *http.Request, fd *os.File, proxy *FileDescriptorProxy)
func ProxyWebSocket ¶
func ProxyWebSocket(w http.ResponseWriter, r *http.Request, terminal *TerminalSettings, proxy *WebSocketProxy)
Types ¶
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 FileDescriptorProxy ¶
type FileDescriptorProxy struct {
StopCh chan error
}
func NewFileDescriptorProxy ¶
func NewFileDescriptorProxy(stoppers int) *FileDescriptorProxy
stoppers is the number of goroutines that may attempt to call Stop()
func (*FileDescriptorProxy) GetStopCh ¶
func (p *FileDescriptorProxy) GetStopCh() chan error
func (*FileDescriptorProxy) Serve ¶
func (p *FileDescriptorProxy) Serve(upstream, downstream io.ReadWriter, upstreamAddr, downstreamAddr string) error
type TerminalSettings ¶
type TerminalSettings struct { // The terminal provider may require use of a particular subprotocol. If so, // it must be specified here, and Workhorse must have a matching codec. Subprotocols []string // The websocket URL to connect to. Url string // Any headers (e.g., Authorization) to send with the websocket request Header http.Header // The CA roots to validate the remote endpoint with, for wss:// URLs. The // system-provided CA pool will be used if this is blank. PEM-encoded data. CAPem string // The value is specified in seconds. It is converted to time.Duration // later. MaxSessionTime int }
func (*TerminalSettings) Clone ¶
func (t *TerminalSettings) Clone() *TerminalSettings
func (*TerminalSettings) Dialer ¶
func (t *TerminalSettings) Dialer() *websocket.Dialer
func (*TerminalSettings) IsEqual ¶
func (t *TerminalSettings) IsEqual(other *TerminalSettings) bool
func (*TerminalSettings) Validate ¶
func (t *TerminalSettings) Validate() error
type WebSocketProxy ¶
type WebSocketProxy struct {
StopCh chan error
}
func NewWebSocketProxy ¶
func NewWebSocketProxy(stoppers int) *WebSocketProxy
stoppers is the number of goroutines that may attempt to call Stop()
func (*WebSocketProxy) GetStopCh ¶
func (p *WebSocketProxy) GetStopCh() chan error
func (*WebSocketProxy) Serve ¶
func (p *WebSocketProxy) Serve(upstream, downstream Connection, upstreamAddr, downstreamAddr string) error
Click to show internal directories.
Click to hide internal directories.