strategy

package
v0.6.11 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2018 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDialer

func NewDialer(s []string, c *Config) proxy.Dialer

NewDialer returns a new strategy dialer

Types

type Checker

type Checker interface {
	Check()
}

Checker is an interface of forwarder checker

type Config

type Config struct {
	Strategy      string
	CheckWebSite  string
	CheckInterval int
	MaxFailures   int
	IntFace       string
}

Config of strategy

type Dialer

type Dialer struct {
	// contains filtered or unexported fields
}

Dialer .

func (*Dialer) Addr

func (d *Dialer) Addr() string

Addr returns forwarder's address

func (*Dialer) Check

func (d *Dialer) Check()

Check implements the Checker interface

func (*Dialer) Dial

func (d *Dialer) Dial(network, addr string) (net.Conn, error)

Dial connects to the address addr on the network net

func (*Dialer) DialUDP

func (d *Dialer) DialUDP(network, addr string) (pc net.PacketConn, writeTo net.Addr, err error)

DialUDP connects to the given address

func (*Dialer) NextDialer

func (d *Dialer) NextDialer(dstAddr string) proxy.Dialer

NextDialer returns the next dialer

func (*Dialer) Priority

func (d *Dialer) Priority() uint32

Priority returns the active priority of dialer

func (*Dialer) SetPriority

func (d *Dialer) SetPriority(p uint32)

SetPriority sets the active priority of daler

Jump to

Keyboard shortcuts

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