Documentation ¶
Index ¶
- Constants
- Variables
- func Sniff(ctx context.Context, r *bufio.Reader) (proto string, err error)
- type HandleOption
- func WithBypass(bypass bypass.Bypass) HandleOption
- func WithDial(dial func(ctx context.Context, network, address string) (net.Conn, error)) HandleOption
- func WithDialTLS(...) HandleOption
- func WithLog(log logger.Logger) HandleOption
- func WithRecorderObject(ro *xrecorder.HandlerRecorderObject) HandleOption
- type HandleOptions
- type Sniffer
Constants ¶
View Source
const ( ProtoHTTP = "http" ProtoTLS = "tls" ProtoSSH = "ssh" )
View Source
const ( // DefaultBodySize is the default HTTP body or websocket frame size to record. DefaultBodySize = 64 * 1024 // 64KB // MaxBodySize is the maximum HTTP body or websocket frame size to record. MaxBodySize = 1024 * 1024 // 1MB // DeafultSampleRate is the default websocket sample rate (samples per second). DefaultSampleRate = 10.0 )
Variables ¶
View Source
var (
DefaultCertPool = tls_util.NewMemoryCertPool()
)
Functions ¶
Types ¶
type HandleOption ¶ added in v0.2.1
type HandleOption func(opts *HandleOptions)
func WithBypass ¶ added in v0.2.1
func WithBypass(bypass bypass.Bypass) HandleOption
func WithDialTLS ¶ added in v0.2.1
func WithLog ¶ added in v0.2.1
func WithLog(log logger.Logger) HandleOption
func WithRecorderObject ¶ added in v0.2.1
func WithRecorderObject(ro *xrecorder.HandlerRecorderObject) HandleOption
type HandleOptions ¶ added in v0.2.1
type Sniffer ¶ added in v0.2.0
type Sniffer struct { Websocket bool WebsocketSampleRate float64 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 ¶ added in v0.2.0
Click to show internal directories.
Click to hide internal directories.