Documentation ¶
Index ¶
- Constants
- Variables
- func IsValidTLSVersion(major, minor byte) bool
- func NewSniffer(name sniffer.Type, snifferConfig SnifferConfig) (sniffer.Sniffer, error)
- func ReadClientHello(data []byte) (*string, error)
- func SniffHTTP(b []byte) (*string, error)
- func SniffTLS(b []byte) (*string, error)
- type BaseSniffer
- type Config
- type Dispatcher
- type HTTPSniffer
- type QuicSniffer
- type SnifferConfig
- type TLSSniffer
Constants ¶
View Source
const ( HTTP1 version = iota HTTP2 )
Variables ¶
Functions ¶
func IsValidTLSVersion ¶
func NewSniffer ¶
func ReadClientHello ¶
ReadClientHello returns server name (if any) from TLS client hello message. https://github.com/golang/go/blob/master/src/crypto/tls/handshake_messages.go#L300
Types ¶
type BaseSniffer ¶
type BaseSniffer struct {
// contains filtered or unexported fields
}
func NewBaseSniffer ¶
func (*BaseSniffer) Protocol ¶
func (*BaseSniffer) Protocol() string
Protocol implements sniffer.Sniffer
func (*BaseSniffer) SniffData ¶
func (*BaseSniffer) SniffData(bytes []byte) (string, error)
SniffData implements sniffer.Sniffer
func (*BaseSniffer) SupportNetwork ¶
func (bs *BaseSniffer) SupportNetwork() constant.NetWork
SupportNetwork implements sniffer.Sniffer
func (*BaseSniffer) SupportPort ¶
func (bs *BaseSniffer) SupportPort(port uint16) bool
SupportPort implements sniffer.Sniffer
type Config ¶ added in v1.18.8
type Config struct { Enable bool Sniffers map[sniffer.Type]SnifferConfig ForceDomain []C.DomainMatcher SkipSrcAddress []C.IpMatcher SkipDstAddress []C.IpMatcher SkipDomain []C.DomainMatcher ForceDnsMapping bool ParsePureIp bool }
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
func NewDispatcher ¶ added in v1.18.8
func NewDispatcher(snifferConfig *Config) (*Dispatcher, error)
func (*Dispatcher) Enable ¶ added in v1.18.8
func (sd *Dispatcher) Enable() bool
func (*Dispatcher) TCPSniff ¶ added in v1.18.8
func (sd *Dispatcher) TCPSniff(conn *N.BufferedConn, metadata *C.Metadata) bool
TCPSniff returns true if the connection is sniffed to have a domain
func (*Dispatcher) UDPSniff ¶ added in v1.18.8
func (sd *Dispatcher) UDPSniff(packet C.PacketAdapter) bool
type HTTPSniffer ¶
type HTTPSniffer struct { *BaseSniffer // contains filtered or unexported fields }
func NewHTTPSniffer ¶
func NewHTTPSniffer(snifferConfig SnifferConfig) (*HTTPSniffer, error)
func (*HTTPSniffer) Protocol ¶
func (http *HTTPSniffer) Protocol() string
func (*HTTPSniffer) SupportNetwork ¶
func (http *HTTPSniffer) SupportNetwork() C.NetWork
type QuicSniffer ¶
type QuicSniffer struct {
*BaseSniffer
}
func NewQuicSniffer ¶
func NewQuicSniffer(snifferConfig SnifferConfig) (*QuicSniffer, error)
func (QuicSniffer) Protocol ¶
func (quic QuicSniffer) Protocol() string
func (QuicSniffer) SupportNetwork ¶
func (quic QuicSniffer) SupportNetwork() C.NetWork
type TLSSniffer ¶
type TLSSniffer struct {
*BaseSniffer
}
func NewTLSSniffer ¶
func NewTLSSniffer(snifferConfig SnifferConfig) (*TLSSniffer, error)
func (*TLSSniffer) Protocol ¶
func (tls *TLSSniffer) Protocol() string
func (*TLSSniffer) SupportNetwork ¶
func (tls *TLSSniffer) SupportNetwork() C.NetWork
Click to show internal directories.
Click to hide internal directories.