Documentation ¶
Index ¶
- Constants
- func ClientTLSConfig(cl *http.Client) *tls.Config
- func CopyURL(u *url.URL) (ret *url.URL)
- func EncodeQuotedString(s string) string
- func ForwardResponse(w http.ResponseWriter, r *http.Response)
- func GzipHandler(h http.Handler) http.Handler
- func NukeCookie(w http.ResponseWriter, r *http.Request, name, path string)
- func OriginatingProtocol(r *http.Request) string
- func RedirectedRequest(r *http.Request, newUrl string) (ret *http.Request, err error)
- func RequestCloseNotifyValue(r *http.Request) <-chan struct{}
- func RequestIsForLocalhost(r *http.Request) bool
- func RequestIsFromLocalhost(r *http.Request) bool
- func RequestWithCloseNotify(r *http.Request, w http.ResponseWriter) *http.Request
- func RequestedURL(r *http.Request) (ret *url.URL)
- func ReverseProxy(w http.ResponseWriter, r *http.Request, originUrl string, client *http.Client) (err error)
- func ReverseProxyUpgrade(w http.ResponseWriter, r *http.Request, originUrl string) (err error)
- func RoundTripHandler(req *http.Request, h http.Handler) (*http.Response, error)
- func SetOriginRequestForwardingHeaders(o, f *http.Request)
- func WrapHandler(middleware []Middleware, h http.Handler) (ret http.Handler)
- func WrapHandlerFunc(middleware []Middleware, hf func(http.ResponseWriter, *http.Request)) (ret http.Handler)
- type BytesContentRange
- type BytesRange
- type CacheControlHeader
- type InProcRoundTripper
- type Middleware
- type Visibility
Constants ¶
const ( Default = 0 Public = 1 Private = 2 )
Variables ¶
This section is empty.
Functions ¶
func ClientTLSConfig ¶
Returns the http.Client's TLS Config, traversing and generating any defaults along the way to get it.
func EncodeQuotedString ¶
Performs quoted-string from http://www.w3.org/Protocols/rfc2616/rfc2616-sec2.html
func ForwardResponse ¶
func ForwardResponse(w http.ResponseWriter, r *http.Response)
func GzipHandler ¶
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 RedirectedRequest ¶
Takes a request, and alters its destination fields, for proxying.
func RequestCloseNotifyValue ¶
func RequestIsForLocalhost ¶
Request is intended for localhost, either with a localhost name, or loopback IP.
func RequestIsFromLocalhost ¶
Request originated from a loopback IP.
func RequestWithCloseNotify ¶
func RequestedURL ¶
Reconstructs the URL that would have produced the given Request. Request.URLs are not fully populated in http.Server handlers.
func ReverseProxy ¶
func ReverseProxyUpgrade ¶
w is for the client response. r is the request to send to the origin (already "forwarded"). originUrl is where to send the request.
func RoundTripHandler ¶
func WrapHandler ¶
func WrapHandler(middleware []Middleware, h http.Handler) (ret http.Handler)
func WrapHandlerFunc ¶
func WrapHandlerFunc(middleware []Middleware, hf func(http.ResponseWriter, *http.Request)) (ret http.Handler)
Types ¶
type BytesContentRange ¶
type BytesContentRange struct {
First, Last, Length int64
}
func ParseBytesContentRange ¶
func ParseBytesContentRange(s string) (ret BytesContentRange, ok bool)
type BytesRange ¶
type BytesRange struct {
First, Last int64
}
func ParseBytesRange ¶
func ParseBytesRange(s string) (ret BytesRange, ok bool)
type CacheControlHeader ¶
type CacheControlHeader struct { MaxAge time.Duration Caching Visibility NoStore bool }
func (CacheControlHeader) String ¶
func (me CacheControlHeader) String() string
type InProcRoundTripper ¶
type Visibility ¶
type Visibility int