router

package
v0.7.6 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2020 License: MIT Imports: 14 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 Port

type Port uint16

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

const (
	HTTP  Port = 80
	HTTPS Port = 443
)

func (Port) Ping

func (p Port) Ping(domain string, dial func(string) (net.Conn, error)) 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) String

func (p Port) String() string

type Route

type Route struct {
	ProxyAddress string

	DetectLevel int // dynamic detect proxy level

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

Route implement a router for each request

func NewRoute added in v0.7.6

func NewRoute(address, password string, detectLevel int,
	blocklist, proxylist, directlist []string, persist func(string)) *Route

func (*Route) GenProxyCheck added in v0.7.4

func (r *Route) GenProxyCheck(sync bool) func(string) (bool, bool)

ShouldProxy check if the domain shoule request though proxy

func (*Route) Get

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

Get implement for cache

Jump to

Keyboard shortcuts

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