engine

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2026 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package engine contains the platform-agnostic DPI-bypass state machine: it consumes an intercepted IPv4 packet stream, tracks the 3-way handshake per flow, and builds a mutated injection packet once the ACK closes the handshake.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Strategy names the bypass algorithm used when Knobs.StrategyRotation
	// is empty. Either wrong_seq or wrong_checksum today.
	Strategy bypass.Name
	// SNIPool is the list of fake SNI values to choose from per flow.
	// Must be non-empty.
	SNIPool []string
	// Scope narrows the flow to a specific 5-tuple-family; only flows
	// matching Scope.LocalIP/RemoteIP/RemotePort are bypassed.
	Scope platform.Scope
	// InjectDelay is used when Knobs.RandomizeTiming is false.
	InjectDelay time.Duration
	// Knobs is the anti-fingerprinting configuration. Zero value matches
	// upstream (fixed delay, fixed size, +1 IP ID, no strategy rotation).
	Knobs fingerprint.Knobs
	// Log is the logger; nil means silent.
	Log Logger
}

Config tunes engine behaviour.

type Engine

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

Engine is the cross-platform bypass state machine.

func New

func New(cfg Config, be platform.Backend) (*Engine, error)

New returns an unstarted Engine bound to a backend.

func (*Engine) Run

func (e *Engine) Run(ctx context.Context) error

Run consumes the backend's packet stream until ctx is done.

type Logger

type Logger interface {
	Debugf(format string, args ...any)
	Infof(format string, args ...any)
	Warnf(format string, args ...any)
}

Logger is the minimum logging surface the engine needs. Implementations can plug into zap/zerolog/slog — the default uses Printf-style lines.

Jump to

Keyboard shortcuts

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