network

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DomainOf

func DomainOf(url string) (domain string)

DomainOf the specified url.

func GetTransport added in v0.1.3

func GetTransport(ps *types.ProxyServer, insecureSkipVerify bool) (transport *http.Transport, e error)

func HTTPGet

func HTTPGet(link string, headers map[string]string, px *types.ProxyServer, timeout, maxTimeout time.Duration,
	cookies ...*http.Cookie) (res *http.Response, e error)

HTTPGet initiates HTTP get request and returns its response

func HTTPGetResponse

func HTTPGetResponse(link string, headers map[string]string, useMasterProxy, rotateAgent bool) (res *http.Response, e error)

HTTPGetResponse initiates HTTP get request and returns its response

func PickProxy

func PickProxy() (proxy *types.ProxyServer, e error)

PickProxy randomly chooses a proxy from database.

func UpdateProxyScore

func UpdateProxyScore(p *types.ProxyServer, success bool)

UpdateProxyScore for the specified proxy.

func UpdateProxyScoreGlobal

func UpdateProxyScoreGlobal(p *types.ProxyServer, success bool)

UpdateProxyScoreGlobal updates globa score for the specified proxy.

func ValidateProxy

func ValidateProxy(ps *types.ProxyServer, probeTimeout int) bool

ValidateProxy checks the status of remote listening port, and further checks if it's a valid proxy server by calling 3rd-party services that return source IP for validation. Note that some of the 3rd-party proxy may further relay the request to downstream nodes, therefore as long as the returned IP address is not the same as our exposed external IP, It will be considered a qualified proxy server at this point.

Types

This section is empty.

Jump to

Keyboard shortcuts

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