route

package
v0.3.7 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SplitModeArgs

func SplitModeArgs(s string) (x unique.Handle[bypass.ModeEnum], ok bool)

func TrimComment

func TrimComment(s string) string

Types

type Args

type Args struct {
	Tag                  string
	Mode                 bypass.Mode
	ResolveStrategy      bypass.ResolveStrategy
	UdpProxyFqdnStrategy bypass.UdpProxyFqdnStrategy
}

func ParseArgs

func ParseArgs(mode bypass.Mode, fs RawArgs) Args

ParseArgs parse args args: tag=tag,udp_proxy_fqdn,resolve_strategy=prefer_ipv6

func (Args) ToModeConfig

func (a Args) ToModeConfig(hostname []string) *bypass.ModeConfig

type Dialer

type Dialer interface {
	Get(ctx context.Context, network string, str string, tag string) (netapi.Proxy, error)
}

type RawArgs added in v0.3.7

type RawArgs []string

func (RawArgs) Range added in v0.3.7

func (a RawArgs) Range(f func(k, v string) bool)

type RejectHistory added in v0.3.7

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

func (*RejectHistory) Get added in v0.3.7

func (h *RejectHistory) Get() *gc.BlockHistoryList

func (*RejectHistory) Push added in v0.3.7

func (h *RejectHistory) Push(ctx context.Context, protocol string, host string)

type Resolver

type Resolver interface {
	Get(str string) netapi.Resolver
}

type Route

type Route struct {
	ProcessDumper netapi.ProcessDumper

	RejectHistory
	// contains filtered or unexported fields
}

func NewRoute

func NewRoute(d Dialer, r Resolver, ProcessDumper netapi.ProcessDumper) *Route

func (*Route) Close

func (f *Route) Close() error

func (*Route) Conn

func (s *Route) Conn(ctx context.Context, host netapi.Address) (net.Conn, error)

func (*Route) Dispatch

func (s *Route) Dispatch(ctx context.Context, host netapi.Address) (netapi.Address, error)

func (*Route) LookupIP

func (f *Route) LookupIP(ctx context.Context, domain string, opts ...func(*netapi.LookupIPOption)) ([]net.IP, error)

func (*Route) PacketConn

func (s *Route) PacketConn(ctx context.Context, host netapi.Address) (net.PacketConn, error)

func (*Route) Raw

func (*Route) Resolver

func (s *Route) Resolver(ctx context.Context, domain string) netapi.Resolver

func (*Route) Search

func (s *Route) Search(ctx context.Context, addr netapi.Address) bypass.ModeEnum

func (*Route) SearchProcess added in v0.3.7

func (s *Route) SearchProcess(ctx context.Context, process string) (bypass.ModeEnum, bool)

func (*Route) Tags

func (s *Route) Tags() iter.Seq[string]

type RuleController added in v0.3.7

type RuleController struct {
	gc.UnimplementedBypassServer
	// contains filtered or unexported fields
}

func NewRuleController added in v0.3.7

func NewRuleController(db config.DB, r *Route) *RuleController

func (*RuleController) BlockHistory added in v0.3.7

func (*RuleController) Load added in v0.3.7

func (s *RuleController) Load(ctx context.Context, empty *emptypb.Empty) (*bypass.Config, error)

func (*RuleController) Reload added in v0.3.7

func (s *RuleController) Reload(ctx context.Context, empty *emptypb.Empty) (*emptypb.Empty, error)

func (*RuleController) Save added in v0.3.7

func (s *RuleController) Save(ctx context.Context, config *bypass.Config) (*emptypb.Empty, error)

func (*RuleController) Test added in v0.3.7

type Uri added in v0.3.7

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

func SplitHostArgs

func SplitHostArgs(s string) (uri *Uri, args string, ok bool)

func (*Uri) Data added in v0.3.7

func (u *Uri) Data() string

func (*Uri) Scheme added in v0.3.7

func (u *Uri) Scheme() string

func (*Uri) SetData added in v0.3.7

func (u *Uri) SetData(str string)

func (*Uri) String added in v0.3.7

func (u *Uri) String() string

Jump to

Keyboard shortcuts

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