recorderproxy

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2022 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CRLF = "\r\n"
)

Variables

This section is empty.

Functions

func DecorateRequest added in v0.2.4

func DecorateRequest(roundTripper http.RoundTripper, req *http.Request) (http.RoundTripper, *http.Request)

func NewConnectReq added in v0.2.4

func NewConnectReq(addr string) *http.Request

func WrapConn added in v0.2.4

func WrapConn(conn net.Conn, label string, dirOut bool) *wrappedConnection

func WrapRequestBody added in v0.2.4

func WrapRequestBody(ctx filters.Context, body io.ReadCloser, contentType string,
	prolog []byte) (*wrappedRequestBody, error)

func WrapResponseBody added in v0.2.4

func WrapResponseBody(ctx filters.Context, body io.ReadCloser, statusCode int32, contentType string,
	recordType contentwriter.RecordType, prolog []byte) (*wrappedResponseBody, error)

Types

type ChainedProxyFilter added in v0.2.4

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

ChainedProxyFilter is a filter which rewrites request to support chained proxies.

func (*ChainedProxyFilter) Apply added in v0.2.4

func (f *ChainedProxyFilter) Apply(ctx filters.Context, req *http.Request, next filters.Next) (resp *http.Response, context filters.Context, err error)

type ContextInitFilter added in v0.2.4

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

ContextInitFilter is a filter which initializes the context with sessions to external services.

func (*ContextInitFilter) Apply added in v0.2.4

func (f *ContextInitFilter) Apply(ctx filters.Context, req *http.Request, next filters.Next) (resp *http.Response, context filters.Context, err error)

type DnsLookupFilter added in v0.2.4

type DnsLookupFilter struct {
	DnsResolverClient dnsresolverV1.DnsResolverClient
}

DnsLookupFilter is a filter which returns an error if the proxy is accessed as if it where a web server and not a proxy.

func (*DnsLookupFilter) Apply added in v0.2.4

func (f *DnsLookupFilter) Apply(ctx filters.Context, req *http.Request, next filters.Next) (resp *http.Response, context filters.Context, err error)

type ErrorHandlerFilter added in v0.2.4

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

ErrorHandlerFilter is a filter which initializes the context with sessions to external services.

func (*ErrorHandlerFilter) Apply added in v0.2.4

func (f *ErrorHandlerFilter) Apply(ctx filters.Context, req *http.Request, next filters.Next) (resp *http.Response, context filters.Context, err error)

type NonproxyFilter added in v0.2.4

type NonproxyFilter struct{}

NonproxyFilter is a filter which returns an error if the proxy is accessed as if it where a web server and not a proxy.

func (*NonproxyFilter) Apply added in v0.2.4

func (f *NonproxyFilter) Apply(ctx filters.Context, req *http.Request, next filters.Next) (resp *http.Response, context filters.Context, err error)

type RecorderFilter added in v0.2.4

type RecorderFilter struct {
	DnsResolverClient dnsresolverV1.DnsResolverClient
	// contains filtered or unexported fields
}

RecorderFilter is a filter which returns an error if the proxy is accessed as if it where a web server and not a proxy.

func (*RecorderFilter) Apply added in v0.2.4

func (f *RecorderFilter) Apply(ctx filters.Context, req *http.Request, next filters.Next) (resp *http.Response, context filters.Context, err error)

type RecorderProxy

type RecorderProxy struct {
	proxy.Proxy

	Addr string

	ConnectionTimeout time.Duration
	// contains filtered or unexported fields
}

func NewRecorderProxy

func NewRecorderProxy(id int, addr string, port int, conn *serviceconnections.Connections, connectionTimeout time.Duration, nextProxyAddr string) *RecorderProxy

func (*RecorderProxy) Close added in v0.2.4

func (proxy *RecorderProxy) Close()

func (*RecorderProxy) Dial added in v0.2.4

func (proxy *RecorderProxy) Dial(context context.Context, isConnect bool, network, addr string) (conn net.Conn, err error)

func (*RecorderProxy) Start

func (proxy *RecorderProxy) Start()

type TracingInitFilter added in v0.2.4

type TracingInitFilter struct{}

TracingInitFilter is a filter which initializes the context with tracing.

func (*TracingInitFilter) Apply added in v0.2.4

func (f *TracingInitFilter) Apply(ctx filters.Context, req *http.Request, next filters.Next) (resp *http.Response, context filters.Context, err error)

Jump to

Keyboard shortcuts

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