uhttp

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2025 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const MAXX_ = "Agent mmmmmmmmAXx_"

Variables

This section is empty.

Functions

func DynamicGetHtmlContent added in v0.0.5

func DynamicGetHtmlContent(url string) (string, error)

func GET

func GET(input RequestInput) (html string, err error)

func POST

func POST(input RequestInput) (html string, err error)

func ReplaceQueryValues added in v0.0.5

func ReplaceQueryValues(originalURL string, replacement string) string

func ResolveURL added in v0.0.5

func ResolveURL(baseURL, href string) string

func StartSimpleHttpServer

func StartSimpleHttpServer(host string, maxRuntime int, callbacks ...Callback) (accessURL string, stopFunc func(), err error)

Types

type Callback

type Callback struct {
	Signal     string
	SignalChan chan bool
	OnRequest  func(r *http.Request, signal string, signalChan chan bool)
	Stop       func()
}

type Form added in v0.0.5

type Form struct {
	Action     string   `json:"action,omitempty"`
	Method     string   `json:"method,omitempty"`
	Enctype    string   `json:"enctype,omitempty"`
	Parameters []string `json:"parameters,omitempty"`
	Submit     string   `json:"submit,omitempty"`
}

func DoExtractFromUrl added in v0.0.5

func DoExtractFromUrl(in RequestInput) (form *Form, injectUrls []string, err error)

func ParsePageFields added in v0.0.5

func ParsePageFields(rawUrl string, document *goquery.Document) ([]Form, []string)

type FormInput added in v0.0.5

type FormInput struct {
	Name  string `json:"name"`
	Type  string `json:"type"`
	Value string `json:"value"`
}

type Option added in v0.0.5

type Option struct {
	RawUrl             string
	Proxy              string
	Timeout            time.Duration
	InsecureSkipVerify bool

	Auth               bool
	Username, Password string

	CaptureForm bool
	// 4 situations where the form submission 2 get the response
	FuncAfterAll func(Result) string
}

type RequestInput

type RequestInput struct {
	RawUrl             string
	Proxy              string
	Timeout            time.Duration
	InsecureSkipVerify bool
	Cookies            []*network.Cookie
	Param              string
}

type Result added in v0.0.5

type Result struct {
	HtmlContent  string
	FormInputs   []FormInput
	SubmitButton SubmitButton
	Cookies      []*network.Cookie
}

func DynamicGetResultFromOption added in v0.0.5

func DynamicGetResultFromOption(option Option) (result Result, err error)

type SubmitButton added in v0.0.5

type SubmitButton struct {
	ID    string `json:"id"`
	Name  string `json:"name"`
	Type  string `json:"type"`
	Value string `json:"value"`
	Text  string `json:"text"`
}

Jump to

Keyboard shortcuts

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