httptoo

package
v0.0.0-...-56cfde8 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2023 License: MIT, MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientTLSConfig

func ClientTLSConfig(cl *http.Client) *tls.Config

Returns the http.Client's TLS Config, traversing and generating any defaults along the way to get it.

func CopyURL

func CopyURL(u *url.URL) (ret *url.URL)

Deep copies a URL.

func ForwardResponse

func ForwardResponse(w http.ResponseWriter, r *http.Response)

func GzipHandler

func GzipHandler(h http.Handler) http.Handler

Gzips response body if the request says it'll allow it.

func NukeCookie

func NukeCookie(w http.ResponseWriter, r *http.Request, name, path string)

Clears the named cookie for every domain that leads to the current one.

func OriginatingProtocol

func OriginatingProtocol(r *http.Request) string

func RedirectedRequest

func RedirectedRequest(r *http.Request, newUrl string) (ret *http.Request, err error)

Takes a request, and alters its destination fields, for proxying.

func RequestedURL

func RequestedURL(r *http.Request) (ret *url.URL)

Reconstructs the URL that would have produced the given Request. Request.URLs are not fully populated in http.Server handlers.

func ReverseProxy

func ReverseProxy(w http.ResponseWriter, r *http.Request, originUrl string, client *http.Client) (err error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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