adapter

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2023 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UnifiedDelay = atomic.NewBool(false)

Functions

func ParseProxy

func ParseProxy(mapping map[string]any) (C.Proxy, error)

Types

type Proxy

type Proxy struct {
	C.ProxyAdapter
	// contains filtered or unexported fields
}

func NewProxy

func NewProxy(adapter C.ProxyAdapter) *Proxy

func (*Proxy) Alive

func (p *Proxy) Alive() bool

Alive implements C.Proxy

func (*Proxy) AliveForTestUrl

func (p *Proxy) AliveForTestUrl(url string) bool

AliveForTestUrl implements C.Proxy

func (*Proxy) DelayHistory

func (p *Proxy) DelayHistory() []C.DelayHistory

DelayHistory implements C.Proxy

func (*Proxy) DelayHistoryForTestUrl

func (p *Proxy) DelayHistoryForTestUrl(url string) []C.DelayHistory

DelayHistoryForTestUrl implements C.Proxy

func (*Proxy) Dial

func (p *Proxy) Dial(metadata *C.Metadata) (C.Conn, error)

Dial implements C.Proxy

func (*Proxy) DialContext

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

DialContext implements C.ProxyAdapter

func (*Proxy) DialUDP

func (p *Proxy) DialUDP(metadata *C.Metadata) (C.PacketConn, error)

DialUDP implements C.ProxyAdapter

func (*Proxy) ExtraDelayHistory

func (p *Proxy) ExtraDelayHistory() map[string][]C.DelayHistory

func (*Proxy) LastDelay

func (p *Proxy) LastDelay() (delay uint16)

LastDelay return last history record. if proxy is not alive, return the max value of uint16. implements C.Proxy

func (*Proxy) LastDelayForTestUrl

func (p *Proxy) LastDelayForTestUrl(url string) (delay uint16)

LastDelayForTestUrl implements C.Proxy

func (*Proxy) ListenPacketContext

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

ListenPacketContext implements C.ProxyAdapter

func (*Proxy) MarshalJSON

func (p *Proxy) MarshalJSON() ([]byte, error)

MarshalJSON implements C.ProxyAdapter

func (*Proxy) URLTest

func (p *Proxy) URLTest(ctx context.Context, url string, expectedStatus utils.IntRanges[uint16], store C.DelayHistoryStoreType) (t uint16, err error)

URLTest get the delay for the specified URL implements C.Proxy

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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