proxy

package
v0.0.0-...-b631e0d Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyResponse

func CopyResponse(w http.ResponseWriter, resp *http.Response)

CopyResponse takes the client response and writes everything to the ResponseWriter in the original handler

Types

type Proxy

type Proxy struct {
	Client  *http.Client
	BaseURL string
}

Proxy holds our configured client and BaseURL to proxy to

func (*Proxy) ProcessRequest

func (p *Proxy) ProcessRequest(r *http.Request) error

ProcessRequest modifies the request in accordnance with Proxy settings

func (*Proxy) ServeHTTP

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

ServeHTTP means that proxy implments the Handler interface It manipulates the request, forwards it to BaseURL, then returns the response

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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