proxy

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2015 License: GPL-3.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ReverseProxy

type ReverseProxy struct {
	// The transport used to perform upstream requests.
	Upstream types.Upstream

	// Logger specifies a logger for errors that occur when attempting
	// to proxy the request.
	Logger types.Logger

	Settings Settings
}

ReverseProxy is an HTTP Handler that takes an incoming request and sends it to another server, proxying the response back to the client.

func New

New returns a configured and ready to use Upstream instance.

func (*ReverseProxy) RequestHandle

func (p *ReverseProxy) RequestHandle(_ context.Context, w http.ResponseWriter, r *http.Request)

RequestHandle implements the nedomi interface

func (*ReverseProxy) ServeHTTP

func (p *ReverseProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request)

type Settings

type Settings struct {
	UserAgent              string `json:"user_agent"`
	HostHeader             string `json:"host_header"`
	HostHeaderKeepOriginal bool   `json:"host_header_keep_original"`
	UpstreamHashPrefix     string `json:"upstream_hash_prefix"`
}

Settings contains the possible settings for the proxy

Jump to

Keyboard shortcuts

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