proxychecker

package
v0.0.0-...-9243012 Latest Latest
Warning

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

Go to latest
Published: May 30, 2019 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddTrace

func AddTrace(r *http.Request) *http.Request

Types

type Checker

type Checker struct {
	Cfg Config
	// contains filtered or unexported fields
}

func NewChecker

func NewChecker(cfg Config) *Checker

func (Checker) CheckProxies

func (c Checker) CheckProxies() (ProxyResults, error)

func (Checker) CheckProxy

func (c Checker) CheckProxy(proxy Proxy) (result ProxyResult)

type Config

type Config struct {
	URL             string
	Method          string
	ForbiddenStatus int
	OkStatus        int
	Trace           bool
	ProxyUser       string
	ProxyPass       string
	ParseIP         func(*http.Response, string) (ip string)
	Realtime        bool
	Concurrency     int
	Proxies         []string
	Sleep           time.Duration
	Timeout         time.Duration
}

func ParseConfig

func ParseConfig(flag *flag.FlagSet) (Config, error)

type Proxy

type Proxy string

type ProxyResult

type ProxyResult struct {
	Proxy  Proxy
	State  ProxyResultState
	Error  error
	IP     string
	Status int
}

func (ProxyResult) SetError

func (pr ProxyResult) SetError(err error) ProxyResult

func (ProxyResult) String

func (pr ProxyResult) String() string

type ProxyResultState

type ProxyResultState int
const (
	Unknown ProxyResultState = iota
	ProxyInvalid
	Timeout
	Error
	Forbidden
	Success
)

func (ProxyResultState) String

func (st ProxyResultState) String() string

type ProxyResults

type ProxyResults []ProxyResult

func (ProxyResults) Len

func (prs ProxyResults) Len() int

func (ProxyResults) Less

func (prs ProxyResults) Less(i, j int) bool

func (ProxyResults) Swap

func (prs ProxyResults) Swap(i, j int)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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