adapter

package
v0.0.0-...-c3b7487 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2024 License: AGPL-3.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnsupportedType = errors.New("unsupported type")
	ErrEmptyDate       = errors.New("empty date")

	ErrParseLink = errors.New("parse link error")
)

Functions

func Base64Decode

func Base64Decode(raw string) string

func NewProxyDirect

func NewProxyDirect() constant.ProxyAdapter

func ToOption

func ToOption(src any) any

Types

type Adapter

type Adapter struct {
	constant.ProxyAdapter
	// contains filtered or unexported fields
}

func NewAdapter

func NewAdapter(c constant.ProxyAdapter, o any) (*Adapter, error)

func NewDirect

func NewDirect() (*Adapter, error)

func ParseClash

func ParseClash(m map[string]any) (*Adapter, error)

func ParseClashWithJson

func ParseClashWithJson(s []byte) (*Adapter, error)

func ParseClashWithYaml

func ParseClashWithYaml(s []byte) (*Adapter, error)

func ParseHysteria

func ParseHysteria(s string) (*Adapter, error)

func ParseHysteria2

func ParseHysteria2(s string) (*Adapter, error)
func ParseLink(s string) (*Adapter, error)

func ParseLinkHttp

func ParseLinkHttp(s string) (*Adapter, error)

func ParseLinkSS

func ParseLinkSS(s string) (*Adapter, error)

func ParseLinkSSR

func ParseLinkSSR(s string) (*Adapter, error)

func ParseLinkSocket5

func ParseLinkSocket5(s string) (*Adapter, error)

func ParseLinkTrojan

func ParseLinkTrojan(s string) (*Adapter, error)

func ParseLinkVless

func ParseLinkVless(s string) (*Adapter, error)

func ParseLinkVmess

func ParseLinkVmess(s string) (*Adapter, error)

func ParseSubscription

func ParseSubscription(b []byte) (nodes []*Adapter)

func (*Adapter) DialForDns

func (p *Adapter) DialForDns(network, addr string) (net.Conn, error)

func (*Adapter) DnsMode

func (p *Adapter) DnsMode(m DnsMode, nameservers ...string) *Adapter

func (*Adapter) GetClient

func (p *Adapter) GetClient() *http.Client

func (*Adapter) GetClientWithTimeout

func (p *Adapter) GetClientWithTimeout(timeout time.Duration) *http.Client

func (*Adapter) Hostname

func (p *Adapter) Hostname() string

func (*Adapter) HttpDial

func (p *Adapter) HttpDial(network, addr string) (net.Conn, error)

func (*Adapter) HttpDialContext

func (p *Adapter) HttpDialContext(ctx context.Context, network, addr string) (net.Conn, error)

func (*Adapter) HttpDialDialer

func (p *Adapter) HttpDialDialer(ctx context.Context, network, addr string, opts ...dialer.Option) (net.Conn, error)

func (*Adapter) Md5

func (p *Adapter) Md5() string

func (*Adapter) R

func (p *Adapter) R() *resty.Request

func (*Adapter) ShortId

func (p *Adapter) ShortId() string

func (*Adapter) String

func (p *Adapter) String() string

func (*Adapter) ToClash

func (p *Adapter) ToClash() map[string]any

func (*Adapter) ToV2ray

func (p *Adapter) ToV2ray() string

func (*Adapter) Transport

func (p *Adapter) Transport() http.RoundTripper

func (*Adapter) TypeString

func (p *Adapter) TypeString() string

func (*Adapter) UniqueId

func (p *Adapter) UniqueId() string

type DnsMode

type DnsMode int
const (
	DnsDisable DnsMode = iota
	DnsDirect
	DnsRemote
)

type ProxyDirect

type ProxyDirect struct {
	*outbound.Direct
}

Jump to

Keyboard shortcuts

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