Documentation ¶
Overview ¶
Package roxy is a simple web proxy that can proxy by host or pattern.
Index ¶
- type Director
- type Proxy
- func (p *Proxy) ClearHosts()
- func (p *Proxy) ClearPatterns()
- func (p *Proxy) ForHost(host string, d Director) *httputil.ReverseProxy
- func (p *Proxy) ForPattern(pattern string, d Director) *httputil.ReverseProxy
- func (p *Proxy) Handle(pattern string, fn http.Handler)
- func (p *Proxy) HandleFunc(pattern string, fn func(http.ResponseWriter, *http.Request))
- func (p *Proxy) RemoveHost(host string)
- func (p *Proxy) RemovePattern(pattern string)
- func (p Proxy) ServeHTTP(rw http.ResponseWriter, req *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Director ¶
Type Director receives an http.Request that will be used as a proxy. It updates it before being passed to the proxied handler.
type Proxy ¶
type Proxy struct { ProxyTLS bool // contains filtered or unexported fields }
Type Proxy implements an http.Handler that proxies http requests
func (*Proxy) ClearHosts ¶
func (p *Proxy) ClearHosts()
ClearHosts clears out all of the directors currently registered.
func (*Proxy) ClearPatterns ¶
func (p *Proxy) ClearPatterns()
ClearPatterns clears out all handlers currently registered.
func (*Proxy) ForHost ¶
func (p *Proxy) ForHost(host string, d Director) *httputil.ReverseProxy
ForHost registers the director for the given host.
func (*Proxy) ForPattern ¶
func (p *Proxy) ForPattern(pattern string, d Director) *httputil.ReverseProxy
ForPattern registers the pattern for the given pattern.
func (*Proxy) HandleFunc ¶
HandleFunc performs the same functionality as http.HandlerFunc
func (*Proxy) RemoveHost ¶
RemoveHost removes the director for the given host.
func (*Proxy) RemovePattern ¶
RemovePattern removes the handler registerd under the given pattern.