sniff

package
v1.10.0-alpha.13 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2024 License: GPL-2.0 Imports: 23 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BitTorrent added in v1.10.0

func BitTorrent(_ context.Context, reader io.Reader) (*adapter.InboundContext, 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 DomainNameQuery

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

func HTTPHost

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

func PeekPacket

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

func PeekStream

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

func QUICClientHello

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

func STUNMessage

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

func StreamDomainNameQuery

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

func TLSClientHello

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

func UDPTracker added in v1.10.0

func UDPTracker(_ context.Context, packet []byte) (*adapter.InboundContext, 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 added in v1.10.0

func UTP(_ context.Context, packet []byte) (*adapter.InboundContext, 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, packet []byte) (*adapter.InboundContext, error)

type StreamSniffer

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

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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