router

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2020 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClientHelloSNIMsg

func NewClientHelloSNIMsg(domain string) []byte

Types

type Node

type Node struct {
	*sync.RWMutex
	// contains filtered or unexported fields
}

func NewNodeFromRules

func NewNodeFromRules(rules ...string) *Node

func (*Node) Add

func (n *Node) Add(item string)

func (*Node) Match

func (n *Node) Match(item string) bool

func (*Node) String

func (n *Node) String() string

type Port

type Port uint16

Port ==========================

const (
	HTTP  Port = 80
	HTTPS Port = 443
)

func (Port) Ping

func (p Port) Ping(domain string, timeout time.Duration) error

Ping try connect to a http(s) server with domain though the http addr

func (Port) PingMsg

func (p Port) PingMsg(domain string) []byte

func (Port) PingWithConn

func (p Port) PingWithConn(domain string, conn net.Conn, timeout time.Duration) error

PingWithConn try connect to a http(s) server with domain though the http addr

func (Port) String

func (p Port) String() string

type Route

type Route struct {
	ProxyAddress  string
	ProxyPassword string

	DetectLevel   int    // dynamic detect proxy level
	DetectTimeout string // dynamic detect timeout

	DirectList []string

	ProxyList []string

	DynamicList []string

	PersistFn func(string)
	// contains filtered or unexported fields
}

func (*Route) Get

func (r *Route) Get(key interface{}) (err error)

func (*Route) ShouldProxy

func (r *Route) ShouldProxy(domain string) bool

ShouldProxy check if the domain shoule request though proxy

Jump to

Keyboard shortcuts

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