proxy

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultBufferCount is the default value for the maximum size of the buffer pool for the reverse proxy.
	DefaultBufferCount = 2 * 1024
	// DefaultBufferSizeBytes is the default value for the length of the buffers in the buffer pool for the reverse proxy.
	DefaultBufferSizeBytes = 32 * 1024
	// DefaultFlushInterval is the default value for the flush interval of reverse proxy to flush to the client while copying the response body.
	DefaultFlushInterval = time.Duration(-1)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option overrides behavior of Proxy.

func WithBufferCount

func WithBufferCount(i int) Option

WithBufferCount sets the buffer count option for the reverse proxy.

func WithBufferSizeBytes

func WithBufferSizeBytes(i int) Option

WithBufferSizeBytes sets the buffer size bytes option for the reverse proxy.

func WithExpectContinueTimeout

func WithExpectContinueTimeout(t time.Duration) Option

WithExpectContinueTimeout sets the max expected continue timeout duration for the underlying reverse proxy transport.

func WithFlushInterval

func WithFlushInterval(t time.Duration) Option

WithFlushInterval sets the flush interval option for the reverse proxy.

func WithIdleConnTimeout

func WithIdleConnTimeout(t time.Duration) Option

WithIdleConnTimeout sets the idle timeout duration for the underlying reverse proxy transport.

func WithKeepAlive

func WithKeepAlive(t time.Duration) Option

WithKeepAlive sets the keep alive duration for the underlying reverse proxy connection.

func WithMaxIdsConns

func WithMaxIdsConns(i int) Option

WithMaxIdsConns sets the max idle conns for the underlying reverse proxy transport.

func WithTLSHandshakeTimeout

func WithTLSHandshakeTimeout(t time.Duration) Option

WithTLSHandshakeTimeout sets the max TLS handshake timeout duration for the underlying reverse proxy transport.

func WithTimeout

func WithTimeout(t time.Duration) Option

WithTimeout sets the timeout duration for the underlying reverse proxy connection.

type Proxy

type Proxy struct {
	// contains filtered or unexported fields
}

func New

func New(logger log.Logger, prefix string, endpoint *url.URL, opts ...Option) *Proxy

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