Help us shape the future of Go! Take the 2026 Go Developer Survey

sniff

package
v1.12.4 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2025 License: GPL-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNeedMoreData = E.New("need more data")

Functions

func BitTorrent

func BitTorrent(_ context.Context, metadata *adapter.InboundContext, reader io.Reader) error

BitTorrent detects if the stream is a BitTorrent connection. For the BitTorrent protocol specification, see https://www.bittorrent.org/beps/bep_0003.html

func DTLSRecord

func DTLSRecord(ctx context.Context, metadata *adapter.InboundContext, packet []byte) error

func DomainNameQuery

func DomainNameQuery(ctx context.Context, metadata *adapter.InboundContext, packet []byte) error

func HTTPHost

func HTTPHost(_ context.Context, metadata *adapter.InboundContext, reader io.Reader) error

func NTP added in v1.12.4

func NTP(ctx context.Context, metadata *adapter.InboundContext, packet []byte) error

func PeekPacket

func PeekPacket(ctx context.Context, metadata *adapter.InboundContext, packet []byte, sniffers ...PacketSniffer) error

func PeekStream

func PeekStream(ctx context.Context, metadata *adapter.InboundContext, conn net.Conn, buffers []*buf.Buffer, buffer *buf.Buffer, timeout time.Duration, sniffers ...StreamSniffer) error

func QUICClientHello

func QUICClientHello(ctx context.Context, metadata *adapter.InboundContext, packet []byte) error

func RDP

func RDP(_ context.Context, metadata *adapter.InboundContext, reader io.Reader) error

func SSH

func SSH(_ context.Context, metadata *adapter.InboundContext, reader io.Reader) error

func STUNMessage

func STUNMessage(_ context.Context, metadata *adapter.InboundContext, packet []byte) error

func Skip

func Skip(metadata *adapter.InboundContext) bool

func StreamDomainNameQuery

func StreamDomainNameQuery(readCtx context.Context, metadata *adapter.InboundContext, reader io.Reader) error

func TLSClientHello

func TLSClientHello(ctx context.Context, metadata *adapter.InboundContext, reader io.Reader) error

func UDPTracker

func UDPTracker(_ context.Context, metadata *adapter.InboundContext, packet []byte) error

UDPTracker detects if the packet is a UDP Tracker Protocol packet. For the UDP Tracker Protocol specification, see https://www.bittorrent.org/beps/bep_0015.html

func UTP

func UTP(_ context.Context, metadata *adapter.InboundContext, packet []byte) error

UTP detects if the packet is a uTP connection packet. For the uTP protocol specification, see

  1. https://www.bittorrent.org/beps/bep_0029.html
  2. https://github.com/bittorrent/libutp/blob/2b364cbb0650bdab64a5de2abb4518f9f228ec44/utp_internal.cpp#L112

Types

type PacketSniffer

type PacketSniffer = func(ctx context.Context, metadata *adapter.InboundContext, packet []byte) error

type StreamSniffer

type StreamSniffer = func(ctx context.Context, metadata *adapter.InboundContext, reader io.Reader) error

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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