shell

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2022 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Link struct {
	// contains filtered or unexported fields
}

Link shell link

func (*Link) Close

func (link *Link) Close()

Close close link

func (*Link) Exec

func (link *Link) Exec() error

Exec execute shell command

func (*Link) Forward

func (link *Link) Forward()

Forward forward data

func (*Link) GetBytes

func (link *Link) GetBytes() (uint64, uint64)

GetBytes get send and recv bytes

func (*Link) GetID

func (link *Link) GetID() string

GetID get link id

func (*Link) GetPackets

func (link *Link) GetPackets() (uint64, uint64)

GetPackets get send and recv packets

func (*Link) SendData

func (link *Link) SendData(data []byte)

SendData send data

func (*Link) SendResize

func (link *Link) SendResize(rows, cols uint32)

SendResize send resize message

type Shell

type Shell struct {
	sync.RWMutex
	Name string
	// contains filtered or unexported fields
}

Shell shell handler

func New

func New(cfg global.Rule, readTimeout, writeTimeout time.Duration) *Shell

New new shell

func (shell *Shell) GetLinks() []rule.Link

GetLinks get rule links

func (*Shell) GetName

func (shell *Shell) GetName() string

GetName get shell rule name

func (*Shell) GetPort

func (shell *Shell) GetPort() uint16

GetPort get listen port

func (*Shell) GetRemote

func (shell *Shell) GetRemote() string

GetRemote get remote target name

func (*Shell) GetTarget

func (shell *Shell) GetTarget() string

GetTarget get target of this rule

func (*Shell) GetTypeName

func (shell *Shell) GetTypeName() string

GetTypeName get shell rule type name

func (*Shell) Handle

func (shell *Shell) Handle(c *conn.Conn)

Handle handle shell

func (*Shell) New

func (shell *Shell) New(conn *conn.Conn, w http.ResponseWriter, r *http.Request)

New new shell

func (shell *Shell) NewLink(id, remote string, localConn net.Conn, remoteConn *conn.Conn) rule.Link

NewLink new link

func (*Shell) Render

func (shell *Shell) Render(w http.ResponseWriter, r *http.Request)

Render render asset file

func (*Shell) Resize

func (shell *Shell) Resize(conn *conn.Conn, w http.ResponseWriter, r *http.Request)

Resize resize terminal

func (*Shell) WS

func (shell *Shell) WS(conn *conn.Conn, w http.ResponseWriter, r *http.Request)

WS websocket for forward data

Jump to

Keyboard shortcuts

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