httpproxy

package
v0.0.0-...-bd88772 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2021 License: BSD-3-Clause Imports: 6 Imported by: 0

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

func (*CensoringProxy) Start

func (p *CensoringProxy) Start(address string) (*http.Server, net.Addr, error)

Start starts the censoring proxy.

Jump to

Keyboard shortcuts

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