proxy

package
v0.0.0-...-c6b72c6 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2020 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RR     = "round_robin"
	RANDOM = "random"
	PING   = "ping"
)

supported chose method

View Source
const (
	DIRECT = "direct"
	HTTP   = "http"
	HTTPS  = "https"
	SOCKS4 = "socks4"
	SOCKS5 = "socks5"

	// shadowsocks protocol
	ShadorSocks = "ss"
)

supported protocols

View Source
const (
	AuthHeader = "Proxy-Authorization"
)

...

Variables

This section is empty.

Functions

This section is empty.

Types

type Host

type Host struct {
	Type      string  // http or socks5 or direct
	Addr      string  // 127.0.0.1:1080
	Ping      float32 // 66 ms
	Available bool
	Auth      proxy.Auth
	// contains filtered or unexported fields
}

Host defines the proxy

func (*Host) CheckAvaliable

func (host *Host) CheckAvaliable() (err error)

func (*Host) Init

func (host *Host) Init() (err error)

func (*Host) ServeHTTP

func (host *Host) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Hosts

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

func (*Hosts) Add

func (h *Hosts) Add(p *Host)

func (*Hosts) Host

func (h *Hosts) Host(i int) *Host

func (*Hosts) Hosts

func (h *Hosts) Hosts() []*Host

func (*Hosts) Len

func (h *Hosts) Len() int32

Jump to

Keyboard shortcuts

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