Documentation ¶
Index ¶
- Constants
- Variables
- func Sniff(ctx context.Context, r *bufio.Reader) (proto string, err error)
- type HandleOption
- func WithBypass(bypass bypass.IBypass) HandleOption
- func WithDial(dial func(ctx context.Context, network, address string) (net.Conn, error)) HandleOption
- func WithDialTLS(...) HandleOption
- func WithLog(log logger.ILogger) 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 ¶
type HandleOption func(opts *HandleOptions)
func WithBypass ¶
func WithBypass(bypass bypass.IBypass) HandleOption
func WithDialTLS ¶
func WithLog ¶
func WithLog(log logger.ILogger) HandleOption
func WithRecorderObject ¶
func WithRecorderObject(ro *xrecorder.HandlerRecorderObject) HandleOption
type HandleOptions ¶
type Sniffer ¶
type Sniffer struct { Websocket bool WebsocketSampleRate float64 Recorder recorder.IRecorder RecorderOptions *recorder.Options // MITM TLS termination Certificate *x509.Certificate PrivateKey crypto.PrivateKey NegotiatedProtocol string CertPool tls_util.CertPool MitmBypass bypass.IBypass ReadTimeout time.Duration }
func (*Sniffer) HandleHTTP ¶
Click to show internal directories.
Click to hide internal directories.