Documentation ¶
Index ¶
- Variables
- func ParseProxy(mapping map[string]any) (C.Proxy, error)
- type Proxy
- func (p *Proxy) Adapter() C.ProxyAdapter
- func (p *Proxy) AliveForTestUrl(url string) bool
- func (p *Proxy) DelayHistory() []C.DelayHistory
- func (p *Proxy) DelayHistoryForTestUrl(url string) []C.DelayHistory
- func (p *Proxy) Dial(metadata *C.Metadata) (C.Conn, error)
- func (p *Proxy) DialContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (C.Conn, error)
- func (p *Proxy) DialUDP(metadata *C.Metadata) (C.PacketConn, error)
- func (p *Proxy) ExtraDelayHistories() map[string]C.ProxyState
- func (p *Proxy) GETResponse(ctx context.Context, url string) (res *[]byte, err error)
- func (p *Proxy) LastDelayForTestUrl(url string) (delay uint16)
- func (p *Proxy) ListenPacketContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (C.PacketConn, error)
- func (p *Proxy) MarshalJSON() ([]byte, error)
- func (p *Proxy) URLHead(ctx context.Context, url string) (err error)
- func (p *Proxy) URLTest(ctx context.Context, url string, expectedStatus utils.IntRanges[uint16]) (t uint16, err error)
- func (p *Proxy) URLTestDelayAndSpeed(ctx context.Context, url string) (t uint16, s float64, err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var UnifiedDelay = atomic.NewBool(false)
Functions ¶
Types ¶
type Proxy ¶
type Proxy struct { C.ProxyAdapter // contains filtered or unexported fields }
func NewProxy ¶
func NewProxy(adapter C.ProxyAdapter) *Proxy
func (*Proxy) AliveForTestUrl ¶
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) DialContext ¶
func (p *Proxy) DialContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (C.Conn, error)
DialContext implements C.ProxyAdapter
func (*Proxy) ExtraDelayHistories ¶
func (p *Proxy) ExtraDelayHistories() map[string]C.ProxyState
ExtraDelayHistories return all delay histories for each test URL implements C.Proxy
func (*Proxy) GETResponse ¶ added in v1.111.5
func (*Proxy) LastDelayForTestUrl ¶
LastDelayForTestUrl return last history record of the specified URL. if proxy is not alive, return the max value of uint16. 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 ¶
MarshalJSON implements C.ProxyAdapter
Click to show internal directories.
Click to hide internal directories.