Documentation ¶
Overview ¶
Package httpproxy contains a censoring HTTP proxy. This proxy will vet all the traffic and reply with 451 responses for a configurable set of offending Host headers in incoming requests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CensoringProxy ¶
type CensoringProxy struct {
// contains filtered or unexported fields
}
CensoringProxy is a censoring HTTP proxy
func NewCensoringProxy ¶
func NewCensoringProxy( keywords []string, uncensored netx.HTTPRoundTripper, ) *CensoringProxy
NewCensoringProxy creates a new CensoringProxy instance using the specified list of keywords to censor. keywords is the list of keywords that trigger censorship if any of them appears in the Host header of a request. dnsNetwork and dnsAddress are settings to configure the upstream, non censored DNS.
func (*CensoringProxy) ServeHTTP ¶
func (p *CensoringProxy) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP serves HTTP requests
Click to show internal directories.
Click to hide internal directories.