proxycheck

package module
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

README

proxycheck

Language Golang Hex.pm codecov Go

Proxy list checker

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// FeedEnd this error happens when the feed runs out of proxies to check
	FeedEnd = errors.New("feed end")
)
View Source
var Judges = map[string]Judge{
	"azenv.php":     AZEnvPhpJudge{},
	"proxyjudge.us": ProxyjudgeUsJudge{},
}

Functions

func Action

func Action(c *cli.Context) error

func ProxyRequest added in v0.0.2

func ProxyRequest(target string, proxyURL *url.URL, timeout time.Duration) ([]byte, error)

ProxyRequest Performs an HTTP request through the proxy specified in the proxyUrl

Types

type AZEnvPhpJudge added in v0.0.2

type AZEnvPhpJudge struct{}

func (AZEnvPhpJudge) TargetURL added in v0.0.2

func (j AZEnvPhpJudge) TargetURL() string

func (AZEnvPhpJudge) Timeout added in v0.0.2

func (j AZEnvPhpJudge) Timeout() time.Duration

type CheckResult added in v0.0.2

type CheckResult struct {
	Protocols []string
	Online    bool
	Err       map[string]error
	Speed     time.Duration
}

func Check added in v0.0.2

func Check(proxyAddr string, judge Judge) (result CheckResult)

type Feed added in v0.0.2

type Feed interface {
	// Next
	// Returns a string in ip:port format of the next proxy to check
	Next() (string, error)
}

Feed Data source interface. Encapsulates the logic of extracting the next proxy for verification.

type FileFeed added in v0.0.2

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

FileFeed Proxy feed from file stream, like stdin, os file.

func NewFileFeed added in v0.0.2

func NewFileFeed(file io.Reader) *FileFeed

func (FileFeed) Next added in v0.0.2

func (f FileFeed) Next() (string, error)

type Judge added in v0.0.2

type Judge interface {
	// TargetURL Returns the url to which you need to contact through the proxy
	TargetURL() string
	// Timeout Returns the recommended timeout for this referee
	Timeout() time.Duration
}

Judge The proxy judge encapsulates the logic of interaction with the proxy judge

type ProxyjudgeUsJudge added in v0.0.5

type ProxyjudgeUsJudge struct{}

func (ProxyjudgeUsJudge) TargetURL added in v0.0.5

func (j ProxyjudgeUsJudge) TargetURL() string

func (ProxyjudgeUsJudge) Timeout added in v0.0.5

func (j ProxyjudgeUsJudge) Timeout() time.Duration

type SliceFeed added in v0.0.2

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

SliceFeed Proxy feed from string slice like this []string{"108.20.30.1:500", "89.33.123.100:40", "50.73.100.1:55"}

func NewSliceFeed added in v0.0.2

func NewSliceFeed(slice []string) *SliceFeed

func (*SliceFeed) Next added in v0.0.2

func (f *SliceFeed) Next() (string, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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