proxy

package
v0.1.15 Latest Latest
Warning

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

Go to latest
Published: May 27, 2016 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ReverseProxy

type ReverseProxy struct {

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

	Settings Settings

	CodesToRetry map[int]string
	// contains filtered or unexported fields
}

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(ctx context.Context, w http.ResponseWriter, r *http.Request)

RequestHandle implements the nedomi interface

func (*ReverseProxy) ServeHTTP

func (p *ReverseProxy) ServeHTTP(ctx context.Context, 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"`
	TryOtherUpstreamOnCode map[string]string `json:"try_other_upstream_on_code"`
}

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