dpiproxy

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2026 License: MIT Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run()

Types

type AutoBlacklist

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

func NewAutoBlacklist

func NewAutoBlacklist(config *Config) *AutoBlacklist

func (*AutoBlacklist) CheckDomain

func (b *AutoBlacklist) CheckDomain(domain string)

func (*AutoBlacklist) IsBlocked

func (b *AutoBlacklist) IsBlocked(domain string) bool

type BlacklistManager

type BlacklistManager interface {
	IsBlocked(domain string) bool
	CheckDomain(domain string)
}

type Config

type Config struct {
	Host           string
	Port           int
	OutHost        string
	OutPort        int
	OutType        string
	OutUsername    string
	OutPassword    string
	BlacklistFile  string
	FragmentMethod string
	DomainMatching string
	LogAccess      string
	LogError       string
	LogDomains     bool
	NoBlacklist    bool
	AutoBlacklist  bool
	Quiet          bool
	Username       string
	Password       string
	FragmentDelay  int
	FragmentMin    int
	FragmentMax    int
	SplitBeforeSNI bool
	SplitAfterSNI  bool
	FakeSNI        string
	FrontMapRaw    string
	FrontMap       map[string]string
	TTL            int
	KeepAlive      bool
	BufferSize     int
	Timeout        int

	ConfigFile string

	EnableSocks5 bool
	Socks5Port   int
	Socks5Host   string

	EnableDoH bool
	DoHServer string
	DoHCache  bool

	BlockQUIC bool
	QUICMode  string
	QUICDelay int

	FakePacket    bool
	FakePacketTTL int

	HTTPObfuscate bool

	Adaptive bool

	TLSGrease  bool
	ECHGrease  bool
	TLSPadding int

	TLSShuffle bool
	TLSProfile string

	FakeSNIPoolRaw string
	FakeSNIPool    []string

	FakePacketCount int
	FragmentJitter  int

	RaceStrategies bool

	Scan           bool
	ScanDomainsRaw string
	ScanDomains    []string

	Preset string

	EnableTransparent bool
	TransparentHost   string
	TransparentPort   int

	TCPFastOpen bool
	TCPMSS      int

	StrategyCacheFile string

	StatsHTTP bool
	StatsPort int

	HostsFile string

	MaxConnections int

	Benchmark bool
	Selftest  bool

	Profiles map[string]*DomainProfile
	// contains filtered or unexported fields
}

func (*Config) GetProfile

func (c *Config) GetProfile(domain string) *DomainProfile

func (*Config) ReloadProfiles

func (c *Config) ReloadProfiles() (int, error)

type DoHResolver

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

func NewDoHResolver

func NewDoHResolver(server string, useCache, queryEnabled bool) *DoHResolver

func (*DoHResolver) Resolve

func (d *DoHResolver) Resolve(domain string) ([]net.IP, error)

func (*DoHResolver) SetStaticHosts

func (d *DoHResolver) SetStaticHosts(hosts map[string][]net.IP)

type DomainDiagnosis

type DomainDiagnosis struct {
	Domain           string
	SystemDNS        []net.IP
	DoHDNS           []net.IP
	DNSMismatch      bool
	TCPDirect        ProbeResult
	TLSDirect        ProbeResult
	TLSFragmentedSNI ProbeResult
	TLSFakeSNI       ProbeResult
	LikelyDPI        bool
	Method           string
	Suggestion       string
}

type DomainProfile

type DomainProfile struct {
	FragmentMethod string
	FragmentMin    int
	FragmentMax    int
	FragmentDelay  int
	FakeSNI        string
	SplitAfterSNI  *bool
}

type FileBlacklist

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

func NewFileBlacklist

func NewFileBlacklist(config *Config) (*FileBlacklist, error)

func (*FileBlacklist) CheckDomain

func (b *FileBlacklist) CheckDomain(domain string)

func (*FileBlacklist) IsBlocked

func (b *FileBlacklist) IsBlocked(domain string) bool

type FragmentStrategy

type FragmentStrategy struct {
	Name          string
	Method        string
	FakeSNI       string
	SplitAfterSNI bool
	FakePacket    bool
}

type HTTPRequest

type HTTPRequest struct {
	Method    string
	URL       string
	Headers   map[string]string
	Raw       []byte
	IsConnect bool
	Host      string
	Port      int
	Body      io.Reader
	Chunked   bool
}

type NoBlacklist

type NoBlacklist struct{}

func (*NoBlacklist) CheckDomain

func (n *NoBlacklist) CheckDomain(domain string)

func (*NoBlacklist) IsBlocked

func (n *NoBlacklist) IsBlocked(domain string) bool

type ProbeResult

type ProbeResult struct {
	OK      bool
	Elapsed time.Duration
	Detail  string
}

type ProxyServer

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

func NewProxyServer

func NewProxyServer(config *Config, stats *Statistics, blacklist BlacklistManager) *ProxyServer

func (*ProxyServer) Start

func (s *ProxyServer) Start() error

func (*ProxyServer) Stop

func (s *ProxyServer) Stop()

type Socks5Server

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

func NewSocks5Server

func NewSocks5Server(config *Config, stats *Statistics, blacklist BlacklistManager, proxy *ProxyServer) *Socks5Server

func (*Socks5Server) Start

func (s *Socks5Server) Start() error

func (*Socks5Server) Stop

func (s *Socks5Server) Stop()

type Statistics

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

func (*Statistics) GetStats

func (s *Statistics) GetStats() string

func (*Statistics) IncrementAllowed

func (s *Statistics) IncrementAllowed()

func (*Statistics) IncrementBlocked

func (s *Statistics) IncrementBlocked()

func (*Statistics) IncrementError

func (s *Statistics) IncrementError()

func (*Statistics) IncrementTotal

func (s *Statistics) IncrementTotal()

func (*Statistics) ReleaseConn

func (s *Statistics) ReleaseConn()

func (*Statistics) TryAcquireConn

func (s *Statistics) TryAcquireConn(max int) bool

func (*Statistics) UpdateTraffic

func (s *Statistics) UpdateTraffic(in, out uint64)

type StrategyRecord

type StrategyRecord struct {
	Strategy  FragmentStrategy
	Attempts  int64
	Successes int64
}

func (*StrategyRecord) Confidence

func (r *StrategyRecord) Confidence() float64

type TransparentServer

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

func NewTransparentServer

func NewTransparentServer(config *Config, stats *Statistics, blacklist BlacklistManager, proxy *ProxyServer) *TransparentServer

func (*TransparentServer) Start

func (s *TransparentServer) Start() error

func (*TransparentServer) Stop

func (s *TransparentServer) Stop()

Jump to

Keyboard shortcuts

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