outboundgroup

package
v1.18.10 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: GPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseProxyGroup

func ParseProxyGroup(config map[string]any, proxyMap map[string]C.Proxy, providersMap map[string]types.ProxyProvider, AllProxies []string, AllProviders []string) (C.ProxyAdapter, error)

Types

type Fallback

type Fallback struct {
	*GroupBase

	Hidden bool
	Icon   string
	// contains filtered or unexported fields
}

func NewFallback

func NewFallback(option *GroupCommonOption, providers []provider.ProxyProvider) *Fallback

func (*Fallback) DialContext

func (f *Fallback) DialContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (C.Conn, error)

DialContext implements C.ProxyAdapter

func (*Fallback) ForceSet

func (f *Fallback) ForceSet(name string)

func (*Fallback) IsL3Protocol

func (f *Fallback) IsL3Protocol(metadata *C.Metadata) bool

IsL3Protocol implements C.ProxyAdapter

func (*Fallback) ListenPacketContext

func (f *Fallback) ListenPacketContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (C.PacketConn, error)

ListenPacketContext implements C.ProxyAdapter

func (*Fallback) MarshalJSON

func (f *Fallback) MarshalJSON() ([]byte, error)

MarshalJSON implements C.ProxyAdapter

func (*Fallback) Now

func (f *Fallback) Now() string

func (*Fallback) Set

func (f *Fallback) Set(name string) error

func (*Fallback) SupportUDP

func (f *Fallback) SupportUDP() bool

SupportUDP implements C.ProxyAdapter

func (*Fallback) Unwrap

func (f *Fallback) Unwrap(metadata *C.Metadata, touch bool) C.Proxy

Unwrap implements C.ProxyAdapter

type GroupBase

type GroupBase struct {
	*outbound.Base

	TestTimeout int
	// contains filtered or unexported fields
}

func NewGroupBase

func NewGroupBase(opt GroupBaseOption) *GroupBase

func (*GroupBase) GetProxies

func (gb *GroupBase) GetProxies(touch bool) []C.Proxy

func (*GroupBase) Touch

func (gb *GroupBase) Touch()

func (*GroupBase) URLTest

func (gb *GroupBase) URLTest(ctx context.Context, url string, expectedStatus utils.IntRanges[uint16]) (map[string]uint16, error)

type GroupBaseOption

type GroupBaseOption struct {
	outbound.BaseOption

	TestTimeout int
	// contains filtered or unexported fields
}

type GroupCommonOption

type GroupCommonOption struct {
	outbound.BasicOption
	Name                string   `group:"name"`
	Type                string   `group:"type"`
	Proxies             []string `group:"proxies,omitempty"`
	Use                 []string `group:"use,omitempty"`
	URL                 string   `group:"url,omitempty"`
	Interval            int      `group:"interval,omitempty"`
	TestTimeout         int      `group:"timeout,omitempty"`
	MaxFailedTimes      int      `group:"max-failed-times,omitempty"`
	Lazy                bool     `group:"lazy,omitempty"`
	DisableUDP          bool     `group:"disable-udp,omitempty"`
	Filter              string   `group:"filter,omitempty"`
	ExcludeFilter       string   `group:"exclude-filter,omitempty"`
	ExcludeType         string   `group:"exclude-type,omitempty"`
	ExpectedStatus      string   `group:"expected-status,omitempty"`
	IncludeAll          bool     `group:"include-all,omitempty"`
	IncludeAllProxies   bool     `group:"include-all-proxies,omitempty"`
	IncludeAllProviders bool     `group:"include-all-providers,omitempty"`
	Hidden              bool     `group:"hidden,omitempty"`
	Icon                string   `group:"icon,omitempty"`
}

type LoadBalance

type LoadBalance struct {
	*GroupBase

	Hidden bool
	Icon   string
	// contains filtered or unexported fields
}

func NewLoadBalance

func NewLoadBalance(option *GroupCommonOption, providers []provider.ProxyProvider, strategy string) (lb *LoadBalance, err error)

func (*LoadBalance) DialContext

func (lb *LoadBalance) DialContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (c C.Conn, err error)

DialContext implements C.ProxyAdapter

func (*LoadBalance) IsL3Protocol

func (lb *LoadBalance) IsL3Protocol(metadata *C.Metadata) bool

IsL3Protocol implements C.ProxyAdapter

func (*LoadBalance) ListenPacketContext

func (lb *LoadBalance) ListenPacketContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (pc C.PacketConn, err error)

ListenPacketContext implements C.ProxyAdapter

func (*LoadBalance) MarshalJSON

func (lb *LoadBalance) MarshalJSON() ([]byte, error)

MarshalJSON implements C.ProxyAdapter

func (*LoadBalance) SupportUDP

func (lb *LoadBalance) SupportUDP() bool

SupportUDP implements C.ProxyAdapter

func (*LoadBalance) Unwrap

func (lb *LoadBalance) Unwrap(metadata *C.Metadata, touch bool) C.Proxy

Unwrap implements C.ProxyAdapter

type Relay

type Relay struct {
	*GroupBase
	Hidden bool
	Icon   string
}

func NewRelay

func NewRelay(option *GroupCommonOption, providers []provider.ProxyProvider) *Relay

func (*Relay) Addr

func (r *Relay) Addr() string

func (*Relay) DialContext

func (r *Relay) DialContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (C.Conn, error)

DialContext implements C.ProxyAdapter

func (*Relay) ListenPacketContext

func (r *Relay) ListenPacketContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (_ C.PacketConn, err error)

ListenPacketContext implements C.ProxyAdapter

func (*Relay) MarshalJSON

func (r *Relay) MarshalJSON() ([]byte, error)

MarshalJSON implements C.ProxyAdapter

func (*Relay) SupportUDP

func (r *Relay) SupportUDP() bool

SupportUDP implements C.ProxyAdapter

type SelectAble

type SelectAble interface {
	Set(string) error
	ForceSet(name string)
}

type Selector

type Selector struct {
	*GroupBase

	Hidden bool
	Icon   string
	// contains filtered or unexported fields
}

func NewSelector

func NewSelector(option *GroupCommonOption, providers []provider.ProxyProvider) *Selector

func (*Selector) DialContext

func (s *Selector) DialContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (C.Conn, error)

DialContext implements C.ProxyAdapter

func (*Selector) ForceSet

func (s *Selector) ForceSet(name string)

func (*Selector) IsL3Protocol

func (s *Selector) IsL3Protocol(metadata *C.Metadata) bool

IsL3Protocol implements C.ProxyAdapter

func (*Selector) ListenPacketContext

func (s *Selector) ListenPacketContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (C.PacketConn, error)

ListenPacketContext implements C.ProxyAdapter

func (*Selector) MarshalJSON

func (s *Selector) MarshalJSON() ([]byte, error)

MarshalJSON implements C.ProxyAdapter

func (*Selector) Now

func (s *Selector) Now() string

func (*Selector) Set

func (s *Selector) Set(name string) error

func (*Selector) SupportUDP

func (s *Selector) SupportUDP() bool

SupportUDP implements C.ProxyAdapter

func (*Selector) Unwrap

func (s *Selector) Unwrap(metadata *C.Metadata, touch bool) C.Proxy

Unwrap implements C.ProxyAdapter

type URLTest

type URLTest struct {
	*GroupBase

	Hidden bool
	Icon   string
	// contains filtered or unexported fields
}

func NewURLTest

func NewURLTest(option *GroupCommonOption, providers []provider.ProxyProvider, options ...urlTestOption) *URLTest

func (*URLTest) DialContext

func (u *URLTest) DialContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (c C.Conn, err error)

DialContext implements C.ProxyAdapter

func (*URLTest) ForceSet

func (u *URLTest) ForceSet(name string)

func (*URLTest) IsL3Protocol

func (u *URLTest) IsL3Protocol(metadata *C.Metadata) bool

IsL3Protocol implements C.ProxyAdapter

func (*URLTest) ListenPacketContext

func (u *URLTest) ListenPacketContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (C.PacketConn, error)

ListenPacketContext implements C.ProxyAdapter

func (*URLTest) MarshalJSON

func (u *URLTest) MarshalJSON() ([]byte, error)

MarshalJSON implements C.ProxyAdapter

func (*URLTest) Now

func (u *URLTest) Now() string

func (*URLTest) Set

func (u *URLTest) Set(name string) error

func (*URLTest) SupportUDP

func (u *URLTest) SupportUDP() bool

SupportUDP implements C.ProxyAdapter

func (*URLTest) URLTest added in v1.18.0

func (u *URLTest) URLTest(ctx context.Context, url string, expectedStatus utils.IntRanges[uint16]) (map[string]uint16, error)

func (*URLTest) Unwrap

func (u *URLTest) Unwrap(metadata *C.Metadata, touch bool) C.Proxy

Unwrap implements C.ProxyAdapter

Jump to

Keyboard shortcuts

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