Documentation
¶
Index ¶
- Constants
- func DecorateRequest(roundTripper http.RoundTripper, req *http.Request) (http.RoundTripper, *http.Request)
- func NewConnectReq(authority string) *http.Request
- func WrapConn(conn net.Conn, label string, dirOut bool) *wrappedConnection
- func WrapRequestBody(ctx context.Context, rc *rpcontext.RecordContext, body io.ReadCloser, ...) (*wrappedRequestBody, error)
- func WrapResponseBody(ctx context.Context, rc *rpcontext.RecordContext, body io.ReadCloser, ...) (*wrappedResponseBody, error)
- type ChainedProxyFilter
- type ContextInitFilter
- type DnsLookupFilter
- type ErrorHandlerFilter
- type NonproxyFilter
- type RecorderFilter
- type RecorderProxy
- func (proxy *RecorderProxy) Dial(ctx context.Context, isConnect bool, network, addr string) (net.Conn, error)
- func (proxy *RecorderProxy) Listen(host string, port int) (net.Listener, error)
- func (proxy *RecorderProxy) Serve(ln net.Listener) error
- func (proxy *RecorderProxy) Shutdown(ctx context.Context) error
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 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
Click to show internal directories.
Click to hide internal directories.