client

package
v0.0.0-...-0d3f7e8 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2022 License: Unlicense Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BrowserMode

func BrowserMode(cfg config.ClientConfig)

BrowserMode: Enable to perform request in browser Set up a local http server with specific endpoint to reach. When this endpoint is reached => request is performed and request body returned with <base> tag added if not present to redirect each link to original URL

func ChangeHTMLBase

func ChangeHTMLBase(htmlB []byte, baseUrl string) (nHtml []byte, err error)

ChangeHTMLBase: Browse an HTML file to add base tag in head one. If base is already defined, return the original HTML If change failed, return original HTML

func PerformRequest

func PerformRequest(cfg config.ClientConfig) (fullResponseText string)

PerformRequest: Perform the HTTP request providing by the client in argument

func Redirect

func Redirect(cfg *config.ClientConfig, response response.Response) (redirectResponseText string, err error)

Types

type RequestHandler

type RequestHandler struct {
	Config config.ClientConfig
	Client http.Client
}

func (*RequestHandler) ProxyHandler

func (rh *RequestHandler) ProxyHandler(w http.ResponseWriter, r *http.Request)

Endpoint to redirect request to other endpoint (in rh.Config object) use to proxify traffic between browser and target with cookie, headers etc

func (*RequestHandler) RequestWebhookHandler

func (rh *RequestHandler) RequestWebhookHandler(w http.ResponseWriter, r *http.Request)

perform a requets when reached

Jump to

Keyboard shortcuts

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