Documentation ¶
Overview ¶
Package proxy contains code for creating red-tape reverse proxies.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeProxy ¶
func MakeProxy(cfg *ProxyConfig) (*httputil.ReverseProxy, error)
func MakeRoundTripper ¶
func MakeRoundTripper(cfg *ProxyConfig) (http.RoundTripper, error)
Types ¶
type ProxyConfig ¶
type ProxyConfig struct { // The destination URL to which the request should be proxied DestURL string // The probability of dropping a packet ProbDrop float64 // The rate of packet delay (sampled from an exponential // distribution) before passing the request to the server PreDelayRate float64 // The maximum delay before passing the request to the server PreDelayMax float64 // The rate of packet delay after receiving the response from // the server, before passing it back to the client PostDelayRate float64 // The maximum delay after receiving the response from the server, // before passing it back to the client PostDelayMax float64 // An optional seed for the random number generator // (0 is treated as no seed) Seed uint64 // If not set, http.DefaultTransport is used. Transport http.RoundTripper // Logger to use Logger log.Logger }
Click to show internal directories.
Click to hide internal directories.