webssh

package
v0.0.0-...-5a2ffeb Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package webssh

Package webssh

Package webssh

Package webssh

Package webssh

Index

Constants

View Source
const (
	MsgData   = '1'
	MsgResize = '2'
)

Variables

This section is empty.

Functions

func NewSSHClient

func NewSSHClient(conf *SSHClientConfig) (*ssh.Client, error)

Types

type AuthModel

type AuthModel int8
const (
	PASSWORD AuthModel = iota + 1
	PUBLICKEY
)

type Resize

type Resize struct {
	Columns int
	Rows    int
}

type SSHClientConfig

type SSHClientConfig struct {
	AuthModel AuthModel
	HostAddr  string
	User      string
	Password  string
	KeyPath   string
	Timeout   time.Duration
}

func SSHClientConfigPassword

func SSHClientConfigPassword(hostAddr, user, Password string) *SSHClientConfig

func SSHClientConfigPublicKey

func SSHClientConfigPublicKey(hostAddr, user, keyPath string) *SSHClientConfig

type Turn

type Turn struct {
	StdinPipe io.WriteCloser
	Session   *ssh.Session
	WsConn    *websocket.Conn
}

func NewTurn

func NewTurn(wsConn *websocket.Conn, sshClient *ssh.Client) (*Turn, error)

func (*Turn) Close

func (t *Turn) Close() error

func (*Turn) LoopRead

func (t *Turn) LoopRead(logBuff *bytes.Buffer, context context.Context) error

func (*Turn) Read

func (t *Turn) Read(p []byte) (n int, err error)

func (*Turn) SessionWait

func (t *Turn) SessionWait() error

func (*Turn) Write

func (t *Turn) Write(p []byte) (n int, err error)

type WebSSH

type WebSSH struct {
	*WebSSHConfig
}

func NewWebSSH

func NewWebSSH(conf *WebSSHConfig) *WebSSH

func (WebSSH) ServeConn

func (w WebSSH) ServeConn(c *fushinServer.Context)

type WebSSHConfig

type WebSSHConfig struct {
	RemoteAddr string
	User       string
	Password   string
	AuthModel  AuthModel
	PkPath     string
}

Jump to

Keyboard shortcuts

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