forwarder

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2024 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Default max body size to record.
	DefaultBodySize = 1024 * 1024 // 1MB
)

Variables

View Source
var (
	DefaultCertPool = tls_util.NewMemoryCertPool()
)

Functions

This section is empty.

Types

type HandleOption

type HandleOption func(opts *HandleOptions)

func WithBypass

func WithBypass(bypass bypass.Bypass) HandleOption

func WithDial

func WithDial(dial func(ctx context.Context, network, address string) (net.Conn, error)) HandleOption

func WithHTTPKeepalive

func WithHTTPKeepalive(keepalive bool) HandleOption

func WithHop

func WithHop(hop hop.Hop) HandleOption

func WithLog

func WithLog(log logger.Logger) HandleOption

func WithNode

func WithNode(node *chain.Node) HandleOption

type HandleOptions

type HandleOptions struct {
	Dial func(ctx context.Context, network, address string) (net.Conn, error)

	HTTPKeepalive  bool
	Node           *chain.Node
	Hop            hop.Hop
	Bypass         bypass.Bypass
	RecorderObject *xrecorder.HandlerRecorderObject
	Log            logger.Logger
}

type Sniffer

type Sniffer struct {
	Recorder        recorder.Recorder
	RecorderOptions *recorder.Options

	// MITM TLS termination
	Certificate        *x509.Certificate
	PrivateKey         crypto.PrivateKey
	NegotiatedProtocol string
	CertPool           tls_util.CertPool
	MitmBypass         bypass.Bypass

	ReadTimeout time.Duration
}

func (*Sniffer) HandleHTTP

func (h *Sniffer) HandleHTTP(ctx context.Context, conn net.Conn, opts ...HandleOption) error

func (*Sniffer) HandleTLS

func (h *Sniffer) HandleTLS(ctx context.Context, conn net.Conn, opts ...HandleOption) error

Jump to

Keyboard shortcuts

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