httpproxy

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2020 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package httpproxy contains the HTTP proxy.

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 httptransport.RoundTripper,
) *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