Documentation ¶
Index ¶
- func BrowserMode(cfg config.ClientConfig)
- func ChangeHTMLBase(htmlB []byte, baseUrl string) (nHtml []byte, err error)
- func PerformRequest(cfg config.ClientConfig) (fullResponseText string)
- func Redirect(cfg *config.ClientConfig, response response.Response) (redirectResponseText string, err error)
- type RequestHandler
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 ¶
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
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