http

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package http provides a http proxy implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanHeader

func CleanHeader(h *http.Header)

CleanHeader cleans the header from the fields that are not intended to be relevant to downstream recipients. See RFC 7230 section 6.1.

func CopyHeader

func CopyHeader(dst, src http.Header)

Types

type Proxy

type Proxy struct {
	dialer.Dialer

	S *http.Server
	C *http.Client
	// contains filtered or unexported fields
}

Proxy represents a HTTP proxy server implementation.

func New

func New() *Proxy

New returns a new Proxy instance that serves HTTP connections.

func (*Proxy) DialWith

func (p *Proxy) DialWith(d dialer.Dialer)

DialWith makes the receiver dial new connections using d, if d != nil.

func (*Proxy) ListenAndServe

func (p *Proxy) ListenAndServe(ctx context.Context, port int) error

ListenAndServe reveals the proxy to the network. If p is storing a complete tls configuration, p will serve HTTPS connections.

func (*Proxy) Protocol

func (p *Proxy) Protocol() string

func (*Proxy) ServeHTTP

func (p *Proxy) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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