Documentation ¶
Index ¶
Constants ¶
View Source
const DefaultConnectionErrorLimit = 10
Variables ¶
View Source
var WebsocketMessageType = map[int]string{ websocket.BinaryMessage: "binary", websocket.TextMessage: "text", websocket.CloseMessage: "close", websocket.PingMessage: "ping", websocket.PongMessage: "pong", }
Functions ¶
func GetHandler ¶
func GetHandler(opts HandlerOpts) func(http.ResponseWriter, *http.Request)
Types ¶
type HandlerOpts ¶
type HandlerOpts struct { // AllowedHostnames is a list of strings which will be matched to the client // requesting for a connection upgrade to a websocket connection AllowedHostnames []string // Arguments is a list of strings to pass as arguments to the specified COmmand Arguments []string // Command is the path to the binary we should create a TTY for Command string // ConnectionErrorLimit defines the number of consecutive errors that can happen // before a connection is considered unusable ConnectionErrorLimit int // CreateLogger when specified should return a logger that the handler will use. // The string argument being passed in will be a unique identifier for the // current connection. When not specified, logs will be sent to stdout CreateLogger func(string, *http.Request) Logger // KeepalivePingTimeout defines the maximum duration between which a ping and pong // cycle should be tolerated, beyond this the connection should be deemed dead KeepalivePingTimeout time.Duration MaxBufferSizeBytes int }
type Logger ¶
type Logger interface { Trace(...interface{}) Tracef(string, ...interface{}) Debug(...interface{}) Debugf(string, ...interface{}) Info(...interface{}) Infof(string, ...interface{}) Warn(...interface{}) Warnf(string, ...interface{}) Error(...interface{}) Errorf(string, ...interface{}) }
Logger is the logging interface used by the xterm.js handler
Click to show internal directories.
Click to hide internal directories.