proxy

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InternalProxyList = []string{
	"https://www.my-proxy.com/free-proxy-list.html",
	"https://www.my-proxy.com/free-proxy-list-2.html",
	"https://www.my-proxy.com/free-proxy-list-3.html",
	"https://www.my-proxy.com/free-proxy-list-4.html",
	"https://www.my-proxy.com/free-proxy-list-5.html",
	"https://www.my-proxy.com/free-proxy-list-6.html",
	"https://www.my-proxy.com/free-proxy-list-7.html",
	"https://www.my-proxy.com/free-proxy-list-8.html",
	"https://www.my-proxy.com/free-proxy-list-9.html",
	"https://www.my-proxy.com/free-proxy-list-10.html",
	"https://www.my-proxy.com/free-elite-proxy.html",
	"https://spys.me/proxy.txt",
}
View Source
var ProxyRegex = regexp.MustCompile(`\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}:\d{1,5}`)

Functions

func Check

func Check(proxies []string, timeout time.Duration, tls bool) []string

Check makes a CONNECT request to the proxy and filters out the ones that don't work.

func MapToSlice

func MapToSlice(proxyMap map[string]struct{}) []string

func Random

func Random(proxiList *ProxyList) func() string

Random returns a new iterator that returns a random proxy from the given list.

func RemoveDuplicates

func RemoveDuplicates(proxyList []string) []string

func RoundRobin

func RoundRobin(proxiList *ProxyList) func() string

RoundRobin returns a new iterator that returns a proxy from the given list in a round-robin fashion.

Types

type ProxyIterator

type ProxyIterator func() string

func Provider

func Provider(algorithm string, proxyList *ProxyList) ProxyIterator

Provider is a iterator builder that returns a new iterator using the given algorithm.

type ProxyList

type ProxyList struct {
	Proxies []string
	// contains filtered or unexported fields
}

func NewProxyList

func NewProxyList(sources []string) *ProxyList

func (*ProxyList) Prune

func (p *ProxyList) Prune(cycles uint, timeout time.Duration, tls bool)

func (*ProxyList) Update

func (p *ProxyList) Update()

Jump to

Keyboard shortcuts

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