recorderproxy

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2026 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func DecorateRequest

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

func NewConnectReq

func NewConnectReq(authority string) *http.Request

func WrapConn

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

func WrapRequestBody

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

func WrapResponseBody

func WrapResponseBody(ctx context.Context, rc *rpcontext.RecordContext, body io.ReadCloser, statusCode int32, contentType string,
	recordType contentwriterV1.RecordType, prolog []byte) (*wrappedResponseBody, error)

Types

type ChainedProxyFilter

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

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

func (*ChainedProxyFilter) Apply

func (f *ChainedProxyFilter) Apply(cs *filters.ConnectionState, req *http.Request, next filters.Next) (resp *http.Response, nextCS *filters.ConnectionState, err error)

type ContextInitFilter

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

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

func (*ContextInitFilter) Apply

func (f *ContextInitFilter) Apply(cs *filters.ConnectionState, req *http.Request, next filters.Next) (resp *http.Response, nextCS *filters.ConnectionState, err error)

type DnsLookupFilter

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

func (f *DnsLookupFilter) Apply(cs *filters.ConnectionState, req *http.Request, next filters.Next) (resp *http.Response, nextCS *filters.ConnectionState, err error)

type ErrorHandlerFilter

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

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

func (*ErrorHandlerFilter) Apply

func (f *ErrorHandlerFilter) Apply(cs *filters.ConnectionState, req *http.Request, next filters.Next) (resp *http.Response, nextCS *filters.ConnectionState, err error)

type NonproxyFilter

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

func (f *NonproxyFilter) Apply(cs *filters.ConnectionState, req *http.Request, next filters.Next) (resp *http.Response, nextCS *filters.ConnectionState, err error)

type RecorderFilter

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

func (f *RecorderFilter) Apply(cs *filters.ConnectionState, req *http.Request, next filters.Next) (resp *http.Response, nextCS *filters.ConnectionState, err error)

type RecorderProxy

type RecorderProxy struct {
	proxy.Proxy

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

func NewRecorderProxy

func NewRecorderProxy(id int, conn *serviceconnections.Connections, nextProxyAddr string) *RecorderProxy

func (*RecorderProxy) Dial

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

func (*RecorderProxy) Listen added in v0.9.0

func (proxy *RecorderProxy) Listen(host string, port int) (net.Listener, error)

func (*RecorderProxy) Serve added in v0.9.0

func (proxy *RecorderProxy) Serve(ln net.Listener) error

func (*RecorderProxy) Shutdown added in v0.9.0

func (proxy *RecorderProxy) Shutdown(ctx context.Context) error

Jump to

Keyboard shortcuts

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