proxy

package module
v2.0.6+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2020 License: MIT Imports: 8 Imported by: 0

README

proxy

TODO

  • Fetch proxies
  • Go routines to filter out transparent proxies
  • Go routines to continuously check latency
  • Priority queue of proxies
  • Proxies have a maximum number of request per seconds to avoid API softbans

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	// testing
	ProxiesTest   chan string
	TimeoutTest   time.Duration
	URLTest       string
	IP            net.IP
	ProxiesTested map[string]int
	MtxTest       sync.Mutex
	FuncTest      func(*http.Client) bool

	// good to use
	MtxGood            sync.Mutex
	ProxiesGood        map[string][]time.Time
	ProxiesGoodStrikes map[string]int
	StrikeLimit        int
	Requests           int
	TimeWindow         time.Duration
	TimeoutGood        time.Duration
}

func NewDefaultManager

func NewDefaultManager() *Manager

func (*Manager) AddProxies

func (m *Manager) AddProxies(proxies ...string)

func (*Manager) ForgiveProxy

func (m *Manager) ForgiveProxy(proxy string)

func (*Manager) GetGoodProxy

func (m *Manager) GetGoodProxy() (string, *http.Client)

func (*Manager) PunishProxy

func (m *Manager) PunishProxy(proxy string)

func (*Manager) WithAutoProxyTester

func (m *Manager) WithAutoProxyTester(concurrentTest int) *Manager

func (*Manager) WithAutoRefresh

func (m *Manager) WithAutoRefresh(every time.Duration) *Manager

func (*Manager) WithFuncTest

func (m *Manager) WithFuncTest(fn func(*http.Client) bool) *Manager

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

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