Documentation ¶
Overview ¶
Package httptransport contains HTTP transport extensions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ByteCountingTransport ¶
type ByteCountingTransport struct { RoundTripper Counter *bytecounter.Counter }
ByteCountingTransport is a RoundTripper that counts bytes.
type Config ¶
type Config struct { Dialer Dialer QUICDialer QUICDialer TLSDialer TLSDialer TLSConfig *tls.Config }
Config contains the configuration required for constructing an HTTP transport
type Dialer ¶
type Dialer interface {
DialContext(ctx context.Context, network, address string) (net.Conn, error)
}
Dialer is the definition of dialer assumed by this package.
type QUICDialer ¶
type QUICDialer interface {
DialContext(ctx context.Context, network, addr string, tlsCfg *tls.Config, cfg *quic.Config) (quic.EarlySession, error)
}
QUICDialer is the definition of dialer for QUIC assumed by this package.
type Resolver ¶
type Resolver interface { LookupHost(ctx context.Context, hostname string) (addrs []string, err error) Network() string Address() string }
Resolver is the interface we expect from a resolver
type RoundTripper ¶
type RoundTripper interface { RoundTrip(req *http.Request) (*http.Response, error) CloseIdleConnections() }
RoundTripper is the definition of http.RoundTripper used by this package.
func NewHTTP3Transport ¶
func NewHTTP3Transport(config Config) RoundTripper
NewHTTP3Transport creates a new HTTP3Transport instance.
Deprecation warning ¶
New code should use netxlite.NewHTTP3Transport instead.
func NewSystemTransport ¶
func NewSystemTransport(config Config) RoundTripper
NewSystemTransport creates a new "system" HTTP transport. That is a transport using the Go standard library with custom dialer and TLS dialer.
Deprecation warning ¶
New code should use netxlite.NewHTTPTransport instead.
type SaverBodyHTTPTransport ¶
type SaverBodyHTTPTransport struct { RoundTripper Saver *trace.Saver SnapshotSize int }
SaverBodyHTTPTransport is a RoundTripper that saves body events occurring during the round trip
type SaverMetadataHTTPTransport ¶
type SaverMetadataHTTPTransport struct { RoundTripper Saver *trace.Saver Transport string }
SaverMetadataHTTPTransport is a RoundTripper that saves events related to HTTP request and response metadata
func (SaverMetadataHTTPTransport) CloneHeaders ¶ added in v3.13.0
func (txp SaverMetadataHTTPTransport) CloneHeaders(req *http.Request) http.Header
CloneHeaders returns a clone of the headers where we have also set the host header, which normally is not set by golang until it serializes the request itself.
type SaverPerformanceHTTPTransport ¶
type SaverPerformanceHTTPTransport struct { RoundTripper Saver *trace.Saver }
SaverPerformanceHTTPTransport is a RoundTripper that saves performance events occurring during the round trip
type SaverTransactionHTTPTransport ¶
type SaverTransactionHTTPTransport struct { RoundTripper Saver *trace.Saver }
SaverTransactionHTTPTransport is a RoundTripper that saves events related to the HTTP transaction