Documentation
¶
Index ¶
- func ParseProxyGroup(config map[string]any, proxyMap map[string]C.Proxy, ...) (C.ProxyAdapter, error)
- type Fallback
- func (f *Fallback) DialContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (C.Conn, error)
- func (f *Fallback) ForceSet(name string)
- func (f *Fallback) IsL3Protocol(metadata *C.Metadata) bool
- func (f *Fallback) ListenPacketContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (C.PacketConn, error)
- func (f *Fallback) MarshalJSON() ([]byte, error)
- func (f *Fallback) Now() string
- func (f *Fallback) Set(name string) error
- func (f *Fallback) SupportUDP() bool
- func (f *Fallback) Unwrap(metadata *C.Metadata, touch bool) C.Proxy
- type GroupBase
- type GroupBaseOption
- type GroupCommonOption
- type LoadBalance
- func (lb *LoadBalance) DialContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (c C.Conn, err error)
- func (lb *LoadBalance) IsL3Protocol(metadata *C.Metadata) bool
- func (lb *LoadBalance) ListenPacketContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (pc C.PacketConn, err error)
- func (lb *LoadBalance) MarshalJSON() ([]byte, error)
- func (lb *LoadBalance) SupportUDP() bool
- func (lb *LoadBalance) Unwrap(metadata *C.Metadata, touch bool) C.Proxy
- type Relay
- func (r *Relay) Addr() string
- func (r *Relay) DialContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (C.Conn, error)
- func (r *Relay) ListenPacketContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (_ C.PacketConn, err error)
- func (r *Relay) MarshalJSON() ([]byte, error)
- func (r *Relay) SupportUDP() bool
- type SelectAble
- type Selector
- func (s *Selector) DialContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (C.Conn, error)
- func (s *Selector) ForceSet(name string)
- func (s *Selector) IsL3Protocol(metadata *C.Metadata) bool
- func (s *Selector) ListenPacketContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (C.PacketConn, error)
- func (s *Selector) MarshalJSON() ([]byte, error)
- func (s *Selector) Now() string
- func (s *Selector) Set(name string) error
- func (s *Selector) SupportUDP() bool
- func (s *Selector) Unwrap(metadata *C.Metadata, touch bool) C.Proxy
- type URLTest
- func (u *URLTest) DialContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (c C.Conn, err error)
- func (u *URLTest) ForceSet(name string)
- func (u *URLTest) IsL3Protocol(metadata *C.Metadata) bool
- func (u *URLTest) ListenPacketContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (C.PacketConn, error)
- func (u *URLTest) MarshalJSON() ([]byte, error)
- func (u *URLTest) Now() string
- func (u *URLTest) Set(name string) error
- func (u *URLTest) SupportUDP() bool
- func (u *URLTest) URLTest(ctx context.Context, url string, expectedStatus utils.IntRanges[uint16]) (map[string]uint16, error)
- func (u *URLTest) Unwrap(metadata *C.Metadata, touch bool) C.Proxy
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseProxyGroup ¶
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) IsL3Protocol ¶
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 ¶
MarshalJSON implements C.ProxyAdapter
func (*Fallback) SupportUDP ¶
SupportUDP implements C.ProxyAdapter
type GroupBase ¶
func NewGroupBase ¶
func NewGroupBase(opt GroupBaseOption) *GroupBase
type GroupBaseOption ¶
type GroupBaseOption struct { outbound.BaseOption TestTimeout int // contains filtered or unexported fields }
type GroupCommonOption ¶
type GroupCommonOption struct { outbound.BasicOption // 继承自 BasicOption 的基本选项 Name string `group:"name" yaml:"name"` // 组的名称 Type string `group:"type" yaml:"type"` // 组的类型 Proxies []string `group:"proxies,omitempty" yaml:"proxies,omitempty"` // 代理列表,可选 Use []string `group:"use,omitempty" yaml:"use,omitempty"` // 使用的选项,可选 URL string `group:"url,omitempty" yaml:"url,omitempty"` // 组的 URL,可选 Interval int `group:"interval,omitempty" yaml:"interval,omitempty"` // 检测间隔,可选 TestTimeout int `group:"timeout,omitempty" yaml:"timeout,omitempty"` // 测试超时时间,可选 MaxFailedTimes int `group:"max-failed-times,omitempty" yaml:"max-failed-times,omitempty"` // 最大失败次数,可选 Lazy bool `group:"lazy,omitempty" yaml:"lazy,omitempty"` // 是否懒加载,可选 DisableUDP bool `group:"disable-udp,omitempty" yaml:"disable-udp,omitempty"` // 是否禁用 UDP,可选 Filter string `group:"filter,omitempty" yaml:"filter,omitempty"` // 过滤器,可选 ExcludeFilter string `group:"exclude-filter,omitempty" yaml:"exclude-filter,omitempty"` // 排除的过滤器,可选 ExcludeType string `group:"exclude-type,omitempty" yaml:"exclude-type,omitempty"` // 排除的类型,可选 ExpectedStatus string `group:"expected-status,omitempty" yaml:"expected-status,omitempty"` // 期望的状态,可选 IncludeAll bool `group:"include-all,omitempty" yaml:"include-all,omitempty"` // 是否包含所有项,可选 IncludeAllProxies bool `group:"include-all-proxies,omitempty" yaml:"include-all-proxies,omitempty"` // 是否包含所有代理,可选 IncludeAllProviders bool `group:"include-all-providers,omitempty" yaml:"include-all-providers,omitempty"` // 是否包含所有提供者,可选 Hidden bool `group:"hidden,omitempty" yaml:"hidden,omitempty"` // 是否隐藏,可选 Icon string `group:"icon,omitempty" yaml:"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
type Relay ¶
func NewRelay ¶
func NewRelay(option *GroupCommonOption, providers []provider.ProxyProvider) *Relay
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 ¶
MarshalJSON implements C.ProxyAdapter
type SelectAble ¶
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) IsL3Protocol ¶
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 ¶
MarshalJSON implements C.ProxyAdapter
func (*Selector) SupportUDP ¶
SupportUDP 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) IsL3Protocol ¶
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 ¶
MarshalJSON implements C.ProxyAdapter
func (*URLTest) SupportUDP ¶
SupportUDP implements C.ProxyAdapter