Documentation ¶
Overview ¶
Package proxy provides a more featureful abstraction on top of httputil.ReverseProxy.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CookieInterceptFunc ¶
type CookieInterceptor ¶
type CookieInterceptor struct {
// contains filtered or unexported fields
}
CookieInterceptor intercepts header writes to modify cookies.
func NewCookieInterceptor ¶
func NewCookieInterceptor(changer CookieInterceptFunc) CookieInterceptor
func (CookieInterceptor) NewWriter ¶
func (ci CookieInterceptor) NewWriter(w http.ResponseWriter) http.ResponseWriter
type HTMLMutator ¶
type HTMLMutator struct {
// contains filtered or unexported fields
}
HTMLMutator provides a wrapper around ResponseWriter to mutate HTML.
func NewHTMLMutator ¶
func NewHTMLMutator(mutator htmlmut.MutateFunc) HTMLMutator
func (HTMLMutator) NewWriter ¶
func (hmu HTMLMutator) NewWriter(w http.ResponseWriter) *HTMLMutatorWriter
type HTMLMutatorWriter ¶
type HTMLMutatorWriter struct { http.ResponseWriter // contains filtered or unexported fields }
func (*HTMLMutatorWriter) ApplyHTML ¶
func (muwr *HTMLMutatorWriter) ApplyHTML() error
ApplyHTML applies the mutator and flushes the body.
func (*HTMLMutatorWriter) WriteHeader ¶
func (muwr *HTMLMutatorWriter) WriteHeader(statusCode int)
type ReverseProxy ¶
type ReverseProxy struct { *httputil.ReverseProxy // contains filtered or unexported fields }
func NewReverseProxy ¶
func NewReverseProxy(target url.URL, htmlMutator htmlmut.MutateFunc) *ReverseProxy
func (*ReverseProxy) ServeHTTP ¶
func (rp *ReverseProxy) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP serves the reverse proxy. If the request has a path that starts with the previously given targetURL, the server will 301 redirect that to a request with the path trimmed.
Click to show internal directories.
Click to hide internal directories.