engine

package
v1.4.4 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: GPL-3.0 Imports: 53 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Tag = "proxy"
)

Variables

This section is empty.

Functions

func Build

func Build(ctx context.Context, n domain.Node, s domain.Settings, logPath string, tun bool) (*option.Options, error)

func Context

func Context(ctx context.Context) context.Context

func Probe

func Probe(ctx context.Context, nodes []domain.Node, s domain.Settings, logPath string, onResult func(string, Result)) (map[string]Result, error)

func ProbeConfig

func ProbeConfig(ctx context.Context, nodes []domain.Node, s domain.Settings, logPath string) (*option.Options, error)

func ProbeTag

func ProbeTag(i int) string

func Rebuilds

func Rebuilds(x, y domain.Settings) bool

func TunInbound

func TunInbound(s domain.Settings, resolverIPs []netip.Prefix) option.Inbound

Types

type Box

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

func (*Box) Apply

func (e *Box) Apply(ctx context.Context, spec SessionSpec) error

func (*Box) Running

func (e *Box) Running() bool

func (*Box) Stop

func (e *Box) Stop() error

type Engine

type Engine interface {
	Apply(context.Context, SessionSpec) error
	Stop() error
	Running() bool
}

func New

func New(ctx context.Context, logPath string) Engine

type NewFunc

type NewFunc func(context.Context, string) Engine

type ProbeFunc

type ProbeFunc func(context.Context, []domain.Node, domain.Settings, string, func(string, Result)) (map[string]Result, error)

type Result

type Result struct {
	Alive bool
	MS    int
}

type SessionSpec

type SessionSpec struct {
	Node     domain.Node
	Settings domain.Settings
	Tun      bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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