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 HTTPSniffer
- type QuicSniffer
- type SnifferConfig
- type SnifferDispatcher
- 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 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 SnifferDispatcher ¶
type SnifferDispatcher struct {
// contains filtered or unexported fields
}
var Dispatcher *SnifferDispatcher
func NewCloseSnifferDispatcher ¶
func NewCloseSnifferDispatcher() (*SnifferDispatcher, error)
func NewSnifferDispatcher ¶
func (*SnifferDispatcher) Enable ¶
func (sd *SnifferDispatcher) Enable() bool
func (*SnifferDispatcher) TCPSniff ¶
func (sd *SnifferDispatcher) TCPSniff(conn *N.BufferedConn, metadata *C.Metadata) bool
TCPSniff returns true if the connection is sniffed to have a domain
func (*SnifferDispatcher) UDPSniff ¶
func (sd *SnifferDispatcher) UDPSniff(packet C.PacketAdapter) bool
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.