client

package
v0.0.0-...-4c094e9 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2023 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const Version = "1.0"

Version WebShell Client current version

Variables

View Source
var UserAgent = fmt.Sprintf("web-shell-client/%s (%s; %s; %s)", Version, runtime.GOOS, runtime.GOARCH, runtime.Version())

UserAgent Request header[User-Agent]

Functions

func ConnectSocket

func ConnectSocket(https bool, host, port, contentpath, path, UserAgent string, conn func(url string) (*websocket.Conn, error))

ConnectSocket c

func LoginServer

func LoginServer(https bool, username, password, host, port, contentpath string, get func(url string) (map[string]interface{}, error)) (string, error)

LoginServer get websocket path

Types

type PipeLine

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

PipeLine Connect websocket and childprocess

func NewPipeLine

func NewPipeLine(conn *websocket.Conn) (*PipeLine, error)

NewPipeLine Malloc PipeLine

func (*PipeLine) ReadSktAndWriteStdio

func (w *PipeLine) ReadSktAndWriteStdio(logChan chan string)

ReadSktAndWriteStdio read skt and write stdout

func (*PipeLine) ReadStdioAndWriteSkt

func (w *PipeLine) ReadStdioAndWriteSkt(logChan chan string)

ReadStdioAndWriteSkt read stdin and write skt

type WebShellClient

type WebShellClient struct {
	Client *http.Client
	Dialer *websocket.Dialer
}

WebShellClient connect to WebShellServer

func (*WebShellClient) GetJSON

func (c *WebShellClient) GetJSON(url string) (map[string]interface{}, error)

GetJSON http get request and parse JSON

func (*WebShellClient) GetRes

func (c *WebShellClient) GetRes(url string) (*http.Response, error)

GetRes http get request

func (*WebShellClient) GetWebsocket

func (c *WebShellClient) GetWebsocket(url string) (*websocket.Conn, error)

GetWebsocket get websocket connection

func (*WebShellClient) Init

func (c *WebShellClient) Init(https bool, crt, key, rootcrt string)

Init http client

func (*WebShellClient) Run

func (c *WebShellClient) Run(https bool, username, password, host, post, contentpath string)

Run WebShellClient

Jump to

Keyboard shortcuts

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