network

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const RETRY int = 3

Variables

This section is empty.

Functions

func DomainOf

func DomainOf(url string) (domain string)

DomainOf the specified url.

func HTTPGet

func HTTPGet(link string, headers map[string]string,
	px *types.ProxyServer, 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 PickGlobalProxy

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

PickGlobalProxy randomly chooses a global proxy from database.

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(stype, host, port, link, keyword string, probeTimeout int) bool

ValidateProxy checks the status of remote listening port, and further checks if it's a valid proxy server

Types

This section is empty.

Jump to

Keyboard shortcuts

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