sniff

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2025 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TlsSniff = ProtocolSnifferWithNetwork{
				// contains filtered or unexported fields
	}
	HTTP1Sniff = ProtocolSnifferWithNetwork{
				// contains filtered or unexported fields
	}
	QUICSniff = ProtocolSnifferWithNetwork{
				// contains filtered or unexported fields
	}
	BTScniff = ProtocolSnifferWithNetwork{
				// contains filtered or unexported fields
	}
	UTPSniff = ProtocolSnifferWithNetwork{
				// contains filtered or unexported fields
	}
)

Adapter functions - created once at package init

Functions

This section is empty.

Types

type CachedConn

type CachedConn struct {
	net.Conn
	// contains filtered or unexported fields
}

Cache, ReadMultiBuffer should be called sequentially.

type CachedDdlPacketConn

type CachedDdlPacketConn struct {
	udp.DdlPacketReaderWriter
	// contains filtered or unexported fields
}

type CachedPacketConn

type CachedPacketConn struct {
	udp.PacketReaderWriter
	// contains filtered or unexported fields
}

func (*CachedPacketConn) ReadPacket

func (r *CachedPacketConn) ReadPacket() (*udp.Packet, error)

type CachedRW

type CachedRW struct {
	buf.DdlReaderWriter
	// contains filtered or unexported fields
}

type CachedReadRw

type CachedReadRw struct {
	buf.ReaderWriter
	// contains filtered or unexported fields
}

Cache, ReadMultiBuffer should be called sequentially.

func (*CachedReadRw) OkayToUnwrapReader

func (r *CachedReadRw) OkayToUnwrapReader() int

func (*CachedReadRw) OkayToUnwrapWriter

func (r *CachedReadRw) OkayToUnwrapWriter() int

func (*CachedReadRw) ReadMultiBuffer

func (r *CachedReadRw) ReadMultiBuffer() (buf.MultiBuffer, error)

func (*CachedReadRw) UnwrapReader

func (r *CachedReadRw) UnwrapReader() any

func (*CachedReadRw) UnwrapWriter

func (r *CachedReadRw) UnwrapWriter() any

type ProtocolSnifferWithNetwork added in v1.0.1

type ProtocolSnifferWithNetwork struct {
	// contains filtered or unexported fields
}

type SniffResult

type SniffResult interface {
	Protocol() string
	Domain() string
}

type SniffSetting added in v1.0.1

type SniffSetting struct {
	Sniffers []ProtocolSnifferWithNetwork
	Interval time.Duration
}

type Sniffer

type Sniffer struct {
	// contains filtered or unexported fields
}

func NewSniffer

func NewSniffer(setting SniffSetting) *Sniffer

NewSniffer returns the singleton sniffer (zero allocation, thread-safe)

func (*Sniffer) Sniff

func (sniffer *Sniffer) Sniff(ctx context.Context, info *session.Info, rw interface{}) (interface{}, error)

Sniff attempts to identify the protocol from the connection

func (*Sniffer) SniffConn

func (sniffer *Sniffer) SniffConn(ctx context.Context, conn net.Conn) (net.Conn, SniffResult, error)

SniffConn sniffs a TCP connection

Jump to

Keyboard shortcuts

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