Documentation
¶
Index ¶
- func AuthPreChecker(i AfterAuthenticated) func(w http.ResponseWriter, r *http.Request)
- func DispatchMessage(sshSession *ssh.Session, messageType websocket.MessageType, wsData []byte, ...) error
- func SignIn(w http.ResponseWriter, r *http.Request)
- type AfterAuthenticated
- type SSHWebSocketHandle
- func (c *SSHWebSocketHandle) SSHShellOverWS(ctx context.Context, ws *websocket.Conn, host string, port int, ...) error
- func (c *SSHWebSocketHandle) ServeAfterAuthenticated(w http.ResponseWriter, r *http.Request, claims *utils.Claims, ...)
- func (c *SSHWebSocketHandle) ShouldClearSessionAfterExec() bool
- type WebSocketBufferWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthPreChecker ¶
func AuthPreChecker(i AfterAuthenticated) func(w http.ResponseWriter, r *http.Request)
func DispatchMessage ¶
func DispatchMessage(sshSession *ssh.Session, messageType websocket.MessageType, wsData []byte, wc io.WriteCloser) error
Types ¶
type AfterAuthenticated ¶
type SSHWebSocketHandle ¶
type SSHWebSocketHandle struct {
// contains filtered or unexported fields
}
func NewSSHWSHandle ¶ added in v0.2.0
func NewSSHWSHandle(bfc int) *SSHWebSocketHandle
func (*SSHWebSocketHandle) SSHShellOverWS ¶ added in v0.2.1
func (c *SSHWebSocketHandle) SSHShellOverWS(ctx context.Context, ws *websocket.Conn, host string, port int, username string, auth ssh.AuthMethod, cols, rows uint32) error
ssh shell over websocket first,we establish a ssh connection to ssh server when a webSocket comes; then we deliver ssh data via ssh connection between browser and ssh server. That is, read webSocket data from browser (e.g. 'ls' command) and send data to ssh server via ssh connection; the other hand, read returned ssh data from ssh server and write back to browser via webSocket API.
func (*SSHWebSocketHandle) ServeAfterAuthenticated ¶
func (c *SSHWebSocketHandle) ServeAfterAuthenticated(w http.ResponseWriter, r *http.Request, claims *utils.Claims, session utils.Session)
handle webSocket connection.
func (*SSHWebSocketHandle) ShouldClearSessionAfterExec ¶
func (c *SSHWebSocketHandle) ShouldClearSessionAfterExec() bool
clear session after ssh closed.
type WebSocketBufferWriter ¶
type WebSocketBufferWriter struct {
// contains filtered or unexported fields
}
write data to WebSocket the data comes from ssh server.
func (*WebSocketBufferWriter) Flush ¶
func (w *WebSocketBufferWriter) Flush(ctx context.Context, messageType websocket.MessageType, ws *websocket.Conn) error
flush all data in this buff into WebSocket.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.