nodpi

package
v0.0.0-...-e25d287 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: MIT Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_proxy_nodpi_config_proto protoreflect.FileDescriptor
View Source
var ReadMore = newError("TLS size is greater than provided buffer")

Functions

This section is empty.

Types

type BlockPredictor

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

func NewBlockPredictor

func NewBlockPredictor() *BlockPredictor

func (*BlockPredictor) NewReporter

func (p *BlockPredictor) NewReporter(conn net.Conn) *ConnSentinel

func (*BlockPredictor) PredictAllow

func (p *BlockPredictor) PredictAllow(sni string) bool

Whether this SNI should go through splitter or not.

type Config

type Config struct {
	ChunkSize  uint32      `protobuf:"varint,1,opt,name=chunk_size,json=chunkSize,proto3" json:"chunk_size,omitempty"`
	ChunkDelay uint32      `protobuf:"varint,2,opt,name=chunk_delay,json=chunkDelay,proto3" json:"chunk_delay,omitempty"`
	IspTtl     uint32      `protobuf:"varint,3,opt,name=isp_ttl,json=ispTtl,proto3" json:"isp_ttl,omitempty"`
	SniFilters *SNIFilters `protobuf:"bytes,4,opt,name=sni_filters,json=sniFilters,proto3" json:"sni_filters,omitempty"`
	Interface  string      `protobuf:"bytes,5,opt,name=interface,proto3" json:"interface,omitempty"`
	// contains filtered or unexported fields
}

func (*Config) Descriptor deprecated

func (*Config) Descriptor() ([]byte, []int)

Deprecated: Use Config.ProtoReflect.Descriptor instead.

func (*Config) GetChunkDelay

func (x *Config) GetChunkDelay() uint32

func (*Config) GetChunkSize

func (x *Config) GetChunkSize() uint32

func (*Config) GetInterface

func (x *Config) GetInterface() string

func (*Config) GetIspTtl

func (x *Config) GetIspTtl() uint32

func (*Config) GetSniFilters

func (x *Config) GetSniFilters() *SNIFilters

func (*Config) ProtoMessage

func (*Config) ProtoMessage()

func (*Config) ProtoReflect

func (x *Config) ProtoReflect() protoreflect.Message

func (*Config) Reset

func (x *Config) Reset()

func (*Config) String

func (x *Config) String() string

type ConnSentinel

type ConnSentinel struct {
	Conn net.Conn
	// contains filtered or unexported fields
}

func DummyReporter

func DummyReporter(conn net.Conn) *ConnSentinel

func (*ConnSentinel) Close

func (s *ConnSentinel) Close()

func (*ConnSentinel) GetSNI

func (s *ConnSentinel) GetSNI() string

func (*ConnSentinel) MarkCanceled

func (s *ConnSentinel) MarkCanceled()

func (*ConnSentinel) Read

func (s *ConnSentinel) Read(buf []byte) (int, error)

func (*ConnSentinel) ReportFailure

func (s *ConnSentinel) ReportFailure()

func (*ConnSentinel) ReportSNI

func (s *ConnSentinel) ReportSNI(sni string)

func (*ConnSentinel) Write

func (s *ConnSentinel) Write(buf []byte) (int, error)

type Handler

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

func (*Handler) Init

func (h *Handler) Init(config *Config, pm policy.Manager, d dns.Client) error

func (*Handler) Process

func (h *Handler) Process(ctx context.Context, link *transport.Link, dialer internet.Dialer) error

type SNIFilters

type SNIFilters struct {
	AdaptiveMode bool     `protobuf:"varint,1,opt,name=adaptive_mode,json=adaptiveMode,proto3" json:"adaptive_mode,omitempty"`
	Whitelist    []string `protobuf:"bytes,2,rep,name=whitelist,proto3" json:"whitelist,omitempty"`
	Blacklist    []string `protobuf:"bytes,3,rep,name=blacklist,proto3" json:"blacklist,omitempty"`
	// contains filtered or unexported fields
}

func (*SNIFilters) Descriptor deprecated

func (*SNIFilters) Descriptor() ([]byte, []int)

Deprecated: Use SNIFilters.ProtoReflect.Descriptor instead.

func (*SNIFilters) GetAdaptiveMode

func (x *SNIFilters) GetAdaptiveMode() bool

func (*SNIFilters) GetBlacklist

func (x *SNIFilters) GetBlacklist() []string

func (*SNIFilters) GetWhitelist

func (x *SNIFilters) GetWhitelist() []string

func (*SNIFilters) ProtoMessage

func (*SNIFilters) ProtoMessage()

func (*SNIFilters) ProtoReflect

func (x *SNIFilters) ProtoReflect() protoreflect.Message

func (*SNIFilters) Reset

func (x *SNIFilters) Reset()

func (*SNIFilters) String

func (x *SNIFilters) String() string

type ScanResult

type ScanResult struct {
	SNI             string
	ShouldIntercept bool
	// contains filtered or unexported fields
}

type TLSHeader

type TLSHeader struct {
	Type    uint8
	Version uint16
}

type TLSRecord

type TLSRecord struct {
	Header TLSHeader
	Body   []byte
}

func (*TLSRecord) Encode

func (r *TLSRecord) Encode() []byte

func (*TLSRecord) SNI

func (r *TLSRecord) SNI() string

func (*TLSRecord) Split

func (r *TLSRecord) Split(size int) (TLSRecord, error)

Modifies current to store `size` bytes and returns rest

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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