server

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: 13 Imported by: 0

Documentation

Index

Constants

View Source
const Server = "web-shell-" + Version

Server Response header[Server]

View Source
const Version = "1.0"

Version WebShell Server current version

Variables

View Source
var StaticHandler http.Handler

StaticHandler reserved for static_gen.go

Functions

func ConnectionHandler

func ConnectionHandler(command string) http.Handler

ConnectionHandler Make websocket and childprocess communicate

func ContentPathHandler

func ContentPathHandler(contentpath string, next http.Handler) http.Handler

ContentPathHandler content path prefix

func GetMethodHandler

func GetMethodHandler(next http.Handler) http.Handler

GetMethodHandler Only allow GET requests

func HTMLDirHandler

func HTMLDirHandler() http.Handler

HTMLDirHandler FileServer

func LoggingHandler

func LoggingHandler(next http.Handler) http.Handler

LoggingHandler Log print

func LoginHandler

func LoginHandler(username, password string) http.Handler

LoginHandler Login interface

func VerifyHandler

func VerifyHandler(username, password string, next http.Handler) http.Handler

VerifyHandler Login verification

Types

type PipeLine

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

PipeLine Connect websocket and childprocess

func NewPipeLine

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

NewPipeLine Malloc PipeLine

func (*PipeLine) ReadPtyAndWriteSkt

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

ReadPtyAndWriteSkt read pty and write skt

func (*PipeLine) ReadSktAndWritePty

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

ReadSktAndWritePty read skt and write pty

type WebShellServer

type WebShellServer struct {
	http.ServeMux
}

WebShellServer Main Server

func (*WebShellServer) Init

func (s *WebShellServer) Init(Username, Password, Command, ContentPath string)

Init WebShell. register handlers

func (*WebShellServer) Run

func (s *WebShellServer) Run(https bool, port, crt, key, rootcrt string)

Run WebShell server

Jump to

Keyboard shortcuts

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