Documentation
¶
Index ¶
- Variables
- type Proxy
- type ProxyChannels
- type ProxyEngine
- func (p5 *ProxyEngine) AddCheckEndpoints(endpoints []string)
- func (p5 *ProxyEngine) AddUserAgents(uagents []string)
- func (p5 *ProxyEngine) ClearSOCKSList()
- func (p5 *ProxyEngine) Close() error
- func (p5 *ProxyEngine) CloseAllConns()
- func (p5 *ProxyEngine) DebugChannel() chan stringdeprecated
- func (p5 *ProxyEngine) DebugEnabled() bool
- func (p5 *ProxyEngine) Dial(network, addr string) (net.Conn, error)
- func (p5 *ProxyEngine) DialContext(ctx context.Context, network, addr string) (net.Conn, error)
- func (p5 *ProxyEngine) DialTimeout(network, addr string, timeout time.Duration) (net.Conn, error)
- func (p5 *ProxyEngine) DisableAutoScaler()
- func (p5 *ProxyEngine) DisableDebug()
- func (p5 *ProxyEngine) DisableDebugRedaction()
- func (p5 *ProxyEngine) DisableHTTPClientTLSVerification()
- func (p5 *ProxyEngine) DisableRecyclerShuffling()
- func (p5 *ProxyEngine) DisableRecycling()
- func (p5 *ProxyEngine) EnableAutoScaler()
- func (p5 *ProxyEngine) EnableDebug()
- func (p5 *ProxyEngine) EnableDebugRedaction()
- func (p5 *ProxyEngine) EnableHTTPClientTLSVerification()
- func (p5 *ProxyEngine) EnableRecyclerShuffling()
- func (p5 *ProxyEngine) EnableRecycling()
- func (p5 *ProxyEngine) GetAnySOCKS() *Proxy
- func (p5 *ProxyEngine) GetAutoScalerStateString() string
- func (p5 *ProxyEngine) GetAutoScalerStatus() bool
- func (p5 *ProxyEngine) GetDebugRedactStatus() bool
- func (p5 *ProxyEngine) GetDialerBailout() int
- func (p5 *ProxyEngine) GetDispenseMiddleware() func(*Proxy) (*Proxy, bool)
- func (p5 *ProxyEngine) GetHTTPClient() *http.Client
- func (p5 *ProxyEngine) GetHTTPTLSVerificationStatus() bool
- func (p5 *ProxyEngine) GetHTTPTunnel() string
- func (p5 *ProxyEngine) GetMaxWorkers() int
- func (p5 *ProxyEngine) GetRandomEndpoint() string
- func (p5 *ProxyEngine) GetRecyclerShuffleStatus() bool
- func (p5 *ProxyEngine) GetRecyclingStatus() bool
- func (p5 *ProxyEngine) GetRemoveAfter() int
- func (p5 *ProxyEngine) GetServerTimeout() time.Duration
- func (p5 *ProxyEngine) GetServerTimeoutStr() string
- func (p5 *ProxyEngine) GetStaleTime() time.Duration
- func (p5 *ProxyEngine) GetStatistics() Statistics
- func (p5 *ProxyEngine) GetTotalBad() int64
- func (p5 *ProxyEngine) GetTotalValidated() int64
- func (p5 *ProxyEngine) GetValidationTimeout() time.Duration
- func (p5 *ProxyEngine) GetValidationTimeoutStr() string
- func (p5 *ProxyEngine) GetWorkers() (maxWorkers, runningWorkers, idleWorkers int)
- func (p5 *ProxyEngine) IsRunning() bool
- func (p5 *ProxyEngine) LoadMultiLineString(socks string) int
- func (p5 *ProxyEngine) LoadProxyTXT(seedFile string) (count int)
- func (p5 *ProxyEngine) LoadSingleProxy(sock string) bool
- func (p5 *ProxyEngine) Pause() error
- func (p5 *ProxyEngine) RandomUserAgent() string
- func (p5 *ProxyEngine) Resume() error
- func (p5 *ProxyEngine) RoundTrip(req *http.Request) (*http.Response, error)
- func (p5 *ProxyEngine) SetAndEnableDebugLogger(l logger.Logger)
- func (p5 *ProxyEngine) SetAutoScalerMaxScale(max int)
- func (p5 *ProxyEngine) SetAutoScalerThreshold(threshold int)
- func (p5 *ProxyEngine) SetCheckEndpoints(newendpoints []string)
- func (p5 *ProxyEngine) SetDebugLogger(l logger.Logger)deprecated
- func (p5 *ProxyEngine) SetDialerBailout(dialattempts int)
- func (p5 *ProxyEngine) SetDispenseMiddleware(f func(*Proxy) (*Proxy, bool))
- func (p5 *ProxyEngine) SetLogger(l logger.Logger)
- func (p5 *ProxyEngine) SetMaxWorkers(num int)
- func (p5 *ProxyEngine) SetRemoveAfter(timesfailed int)
- func (p5 *ProxyEngine) SetServerTimeout(timeout time.Duration)
- func (p5 *ProxyEngine) SetStaleTime(newtime time.Duration)
- func (p5 *ProxyEngine) SetUserAgents(uagents []string)
- func (p5 *ProxyEngine) SetValidationTimeout(timeout time.Duration)
- func (p5 *ProxyEngine) Socks4Str() string
- func (p5 *ProxyEngine) Socks4aStr() string
- func (p5 *ProxyEngine) Socks5Str() string
- func (p5 *ProxyEngine) Start() error
- func (p5 *ProxyEngine) StartSOCKS5Server(listen, username, password string) error
- type ProxyProtocol
- type SocksLogger
- type Statistics
- type Swampdeprecated
- func NewDefaultSwamp() *Swampdeprecated
Constants ¶
This section is empty.
Variables ¶
var ErrNoProxies = fmt.Errorf("no proxies available")
Functions ¶
This section is empty.
Types ¶
type Proxy ¶
type Proxy struct { // Endpoint is the address:port of the proxy that we connect to Endpoint string // ProxiedIP is the address that we end up having when making proxied requests through this proxy // TODO: parse this and store as flat int type ProxiedIP string // contains filtered or unexported fields }
Proxy represents an individual proxy
func (*Proxy) GetProto ¶
func (sock *Proxy) GetProto() ProxyProtocol
GetProto retrieves the known protocol value of the Proxy.
func (*Proxy) UniqueKey ¶
UniqueKey is an implementation of the Identity interface from Rate5. See: https://pkgo.dev/github.com/yunginnanet/Rate5#Identity
type ProxyChannels ¶ added in v0.7.0
type ProxyChannels struct { // SOCKS5 is a constant stream of verified SOCKS5 proxies SOCKS5 proxyList // SOCKS4 is a constant stream of verified SOCKS4 proxies SOCKS4 proxyList // SOCKS4a is a constant stream of verified SOCKS5 proxies SOCKS4a proxyList // HTTP is a constant stream of verified SOCKS5 proxies HTTP proxyList }
ProxyChannels will likely be unexported in the future.
func (ProxyChannels) Slice ¶ added in v0.9.0
func (pc ProxyChannels) Slice() []*proxyList
Slice returns a slice of all proxyLists in ProxyChannels, note that HTTP is not included.
type ProxyEngine ¶ added in v0.7.8
type ProxyEngine struct { Valids ProxyChannels DebugLogger logger.Logger Status uint32 // Pending is a constant stream of proxy strings to be verified Pending proxyList // contains filtered or unexported fields }
ProxyEngine represents a proxy pool
func NewProxyEngine ¶ added in v0.7.0
func NewProxyEngine() *ProxyEngine
NewProxyEngine returns a ProxyEngine with default options. After calling this you may use the various "setters" to change the options before calling ProxyEngine.Start().
func (*ProxyEngine) AddCheckEndpoints ¶ added in v0.7.8
func (p5 *ProxyEngine) AddCheckEndpoints(endpoints []string)
AddCheckEndpoints appends entries to the running list of whatismyip style endpoitns for validation. (must return only the WAN IP)
func (*ProxyEngine) AddUserAgents ¶ added in v0.7.8
func (p5 *ProxyEngine) AddUserAgents(uagents []string)
AddUserAgents appends to the list of useragents we randomly choose from during proxied requests
func (*ProxyEngine) ClearSOCKSList ¶ added in v0.7.8
func (p5 *ProxyEngine) ClearSOCKSList()
ClearSOCKSList clears the map of proxies that we have on record. Other operations (proxies that are still in buffered channels) will continue.
func (*ProxyEngine) Close ¶ added in v0.9.6
func (p5 *ProxyEngine) Close() error
func (*ProxyEngine) CloseAllConns ¶ added in v0.9.0
func (p5 *ProxyEngine) CloseAllConns()
CloseAllConns will (maybe) close all connections in progress by the dialers (including the SOCKS server if in use). Note this does not effect the proxy pool, it will continue to operate as normal. this is hacky FIXME
func (*ProxyEngine) DebugChannel
deprecated
added in
v0.7.8
func (p5 *ProxyEngine) DebugChannel() chan string
DebugChannel will return a channel which will receive debug messages once debug is enabled. This will alter the flow of debug messages, they will no longer print to console, they will be pushed into this channel. Make sure you pull from the channel eventually to avoid build up of blocked goroutines.
Deprecated: use DebugLogger instead. This will be removed in a future version.
func (*ProxyEngine) DebugEnabled ¶ added in v0.7.8
func (p5 *ProxyEngine) DebugEnabled() bool
DebugEnabled returns the current state of our debug switch.
func (*ProxyEngine) Dial ¶ added in v0.7.8
func (p5 *ProxyEngine) Dial(network, addr string) (net.Conn, error)
Dial is a simple stub adapter to implement a net.Dialer.
func (*ProxyEngine) DialContext ¶ added in v0.7.8
DialContext is a simple stub adapter to implement a net.Dialer.
func (*ProxyEngine) DialTimeout ¶ added in v0.7.8
DialTimeout is a simple stub adapter to implement a net.Dialer with a timeout.
func (*ProxyEngine) DisableAutoScaler ¶ added in v0.7.8
func (p5 *ProxyEngine) DisableAutoScaler()
DisableAutoScaler disables the autoscaler.
func (*ProxyEngine) DisableDebug ¶ added in v0.7.8
func (p5 *ProxyEngine) DisableDebug()
DisableDebug enables printing of verbose messages during operation. WARNING: if you are using a DebugChannel, you must read all of the messages in the channel's cache or this will block.
func (*ProxyEngine) DisableDebugRedaction ¶ added in v0.7.8
func (p5 *ProxyEngine) DisableDebugRedaction()
func (*ProxyEngine) DisableHTTPClientTLSVerification ¶ added in v0.9.0
func (p5 *ProxyEngine) DisableHTTPClientTLSVerification()
func (*ProxyEngine) DisableRecyclerShuffling ¶ added in v0.9.0
func (p5 *ProxyEngine) DisableRecyclerShuffling()
func (*ProxyEngine) DisableRecycling ¶ added in v0.7.8
func (p5 *ProxyEngine) DisableRecycling()
DisableRecycling disables recycling used proxies back into the pending channel for revalidation after dispensed.
func (*ProxyEngine) EnableAutoScaler ¶ added in v0.7.8
func (p5 *ProxyEngine) EnableAutoScaler()
EnableAutoScaler enables the autoscaler. This will automatically scale up the number of workers based on the threshold of dial attempts versus validated proxies.
func (*ProxyEngine) EnableDebug ¶ added in v0.7.8
func (p5 *ProxyEngine) EnableDebug()
EnableDebug enables printing of verbose messages during operation
func (*ProxyEngine) EnableDebugRedaction ¶ added in v0.7.8
func (p5 *ProxyEngine) EnableDebugRedaction()
func (*ProxyEngine) EnableHTTPClientTLSVerification ¶ added in v0.9.0
func (p5 *ProxyEngine) EnableHTTPClientTLSVerification()
func (*ProxyEngine) EnableRecyclerShuffling ¶ added in v0.9.0
func (p5 *ProxyEngine) EnableRecyclerShuffling()
func (*ProxyEngine) EnableRecycling ¶ added in v0.7.8
func (p5 *ProxyEngine) EnableRecycling()
EnableRecycling enables recycling used proxies back into the pending channel for revalidation after dispensed.
func (*ProxyEngine) GetAnySOCKS ¶ added in v0.7.8
func (p5 *ProxyEngine) GetAnySOCKS() *Proxy
GetAnySOCKS retrieves any version SOCKS proxy as a Proxy type Will block if one is not available!
func (*ProxyEngine) GetAutoScalerStateString ¶ added in v0.7.8
func (p5 *ProxyEngine) GetAutoScalerStateString() string
func (*ProxyEngine) GetAutoScalerStatus ¶ added in v0.7.8
func (p5 *ProxyEngine) GetAutoScalerStatus() bool
func (*ProxyEngine) GetDebugRedactStatus ¶ added in v0.7.8
func (p5 *ProxyEngine) GetDebugRedactStatus() bool
func (*ProxyEngine) GetDialerBailout ¶ added in v0.7.8
func (p5 *ProxyEngine) GetDialerBailout() int
GetDialerBailout retrieves the dialer bailout policy. See SetDialerBailout for more info.
func (*ProxyEngine) GetDispenseMiddleware ¶ added in v0.7.8
func (p5 *ProxyEngine) GetDispenseMiddleware() func(*Proxy) (*Proxy, bool)
func (*ProxyEngine) GetHTTPClient ¶ added in v0.7.8
func (p5 *ProxyEngine) GetHTTPClient() *http.Client
GetHTTPClient retrieves a pointer to an http.Client powered by mysteryDialer.
func (*ProxyEngine) GetHTTPTLSVerificationStatus ¶ added in v0.9.0
func (p5 *ProxyEngine) GetHTTPTLSVerificationStatus() bool
func (*ProxyEngine) GetHTTPTunnel ¶ added in v0.7.8
func (p5 *ProxyEngine) GetHTTPTunnel() string
GetHTTPTunnel checks for an available HTTP CONNECT proxy in our pool.
func (*ProxyEngine) GetMaxWorkers ¶ added in v0.7.8
func (p5 *ProxyEngine) GetMaxWorkers() int
GetMaxWorkers returns maximum amount of workers that validate proxies concurrently. Note this is read-only during runtime.
func (*ProxyEngine) GetRandomEndpoint ¶ added in v0.7.8
func (p5 *ProxyEngine) GetRandomEndpoint() string
GetRandomEndpoint returns a random whatismyip style endpoint from our ProxyEngine's options
func (*ProxyEngine) GetRecyclerShuffleStatus ¶ added in v0.9.0
func (p5 *ProxyEngine) GetRecyclerShuffleStatus() bool
func (*ProxyEngine) GetRecyclingStatus ¶ added in v0.7.8
func (p5 *ProxyEngine) GetRecyclingStatus() bool
GetRecyclingStatus retrieves the current recycling status, see EnableRecycling.
func (*ProxyEngine) GetRemoveAfter ¶ added in v0.7.8
func (p5 *ProxyEngine) GetRemoveAfter() int
GetRemoveAfter retrieves the removeafter policy, the amount of times a recycled proxy is marked as bad until it is removed entirely.
- returns -1 if recycling is disabled.
func (*ProxyEngine) GetServerTimeout ¶ added in v0.7.8
func (p5 *ProxyEngine) GetServerTimeout() time.Duration
GetServerTimeout returns the current value of serverTimeout.
func (*ProxyEngine) GetServerTimeoutStr ¶ added in v0.7.8
func (p5 *ProxyEngine) GetServerTimeoutStr() string
GetServerTimeoutStr returns the current value of serverTimeout (in seconds string).
func (*ProxyEngine) GetStaleTime ¶ added in v0.7.8
func (p5 *ProxyEngine) GetStaleTime() time.Duration
GetStaleTime returns the duration of time after which a proxy will be considered "stale".
func (*ProxyEngine) GetStatistics ¶ added in v0.7.8
func (p5 *ProxyEngine) GetStatistics() Statistics
GetStatistics returns all Statistics atomics.
func (*ProxyEngine) GetTotalBad ¶ added in v0.8.0
func (p5 *ProxyEngine) GetTotalBad() int64
func (*ProxyEngine) GetTotalValidated ¶ added in v0.7.8
func (p5 *ProxyEngine) GetTotalValidated() int64
GetTotalValidated retrieves our grand total validated proxy count.
func (*ProxyEngine) GetValidationTimeout ¶ added in v0.7.8
func (p5 *ProxyEngine) GetValidationTimeout() time.Duration
GetValidationTimeout returns the current value of validationTimeout.
func (*ProxyEngine) GetValidationTimeoutStr ¶ added in v0.7.8
func (p5 *ProxyEngine) GetValidationTimeoutStr() string
GetValidationTimeoutStr returns the current value of validationTimeout (in seconds string).
func (*ProxyEngine) GetWorkers ¶ added in v0.7.8
func (p5 *ProxyEngine) GetWorkers() (maxWorkers, runningWorkers, idleWorkers int)
GetWorkers retrieves pond worker Statistics:
- return MaxWorkers, RunningWorkers, IdleWorkers
func (*ProxyEngine) IsRunning ¶ added in v0.7.8
func (p5 *ProxyEngine) IsRunning() bool
IsRunning returns true if our background goroutines defined in daemons.go are currently operational
func (*ProxyEngine) LoadMultiLineString ¶ added in v0.7.8
func (p5 *ProxyEngine) LoadMultiLineString(socks string) int
LoadMultiLineString loads a multiine string object with proxy per line. Expects one of the following formats for each line:
- 127.0.0.1:1080
- 127.0.0.1:1080:user:pass
- yeet.com:1080
- yeet.com:1080:user:pass
- [fe80::2ef0:5dff:fe7f:c299]:1080
- [fe80::2ef0:5dff:fe7f:c299]:1080:user:pass
func (*ProxyEngine) LoadProxyTXT ¶ added in v0.7.8
func (p5 *ProxyEngine) LoadProxyTXT(seedFile string) (count int)
LoadProxyTXT loads proxies from a given seed file and feeds them to the mapBuilder to be later queued automatically for validation. Expects one of the following formats for each line:
- 127.0.0.1:1080
- 127.0.0.1:1080:user:pass
- yeet.com:1080
- yeet.com:1080:user:pass
- [fe80::2ef0:5dff:fe7f:c299]:1080
- [fe80::2ef0:5dff:fe7f:c299]:1080:user:pass
func (*ProxyEngine) LoadSingleProxy ¶ added in v0.7.8
func (p5 *ProxyEngine) LoadSingleProxy(sock string) bool
LoadSingleProxy loads a SOCKS proxy into our map. Expects one of the following formats:
- 127.0.0.1:1080
- 127.0.0.1:1080:user:pass
- yeet.com:1080
- yeet.com:1080:user:pass
- [fe80::2ef0:5dff:fe7f:c299]:1080
- [fe80::2ef0:5dff:fe7f:c299]:1080:user:pass
func (*ProxyEngine) Pause ¶ added in v0.7.8
func (p5 *ProxyEngine) Pause() error
Pause will cease the creation of any new proxy validation operations.
- You will be able to start the proxy pool again with ProxyEngine.Resume(), it will have the same Statistics, options, and ratelimits.
- During pause you are still able to dispense proxies.
- Options may be changed and proxy lists may be loaded when paused.
- Pausing an already paused ProxyEngine is a nonop.
func (*ProxyEngine) RandomUserAgent ¶ added in v0.7.8
func (p5 *ProxyEngine) RandomUserAgent() string
RandomUserAgent retrieves a random user agent from our list in string form.
func (*ProxyEngine) Resume ¶ added in v0.7.8
func (p5 *ProxyEngine) Resume() error
Resume will resume pause proxy pool operations, attempting to resume a running ProxyEngine is returns an error.
func (*ProxyEngine) RoundTrip ¶ added in v0.7.8
RoundTrip is Mr. WorldWide. Obviously. See: https://pkgo.dev/net/http#RoundTripper
func (*ProxyEngine) SetAndEnableDebugLogger ¶ added in v0.9.5
func (p5 *ProxyEngine) SetAndEnableDebugLogger(l logger.Logger)
func (*ProxyEngine) SetAutoScalerMaxScale ¶ added in v0.7.94
func (p5 *ProxyEngine) SetAutoScalerMaxScale(max int)
SetAutoScalerMaxScale sets the relative maximum amount that the autoscaler will scale up.
func (*ProxyEngine) SetAutoScalerThreshold ¶ added in v0.7.94
func (p5 *ProxyEngine) SetAutoScalerThreshold(threshold int)
SetAutoScalerThreshold sets the threshold of validated proxies versus dials that will trigger the autoscaler.
func (*ProxyEngine) SetCheckEndpoints ¶ added in v0.7.8
func (p5 *ProxyEngine) SetCheckEndpoints(newendpoints []string)
SetCheckEndpoints replaces the running list of whatismyip style endpoitns for validation. (must return only the WAN IP)
func (*ProxyEngine) SetDebugLogger
deprecated
added in
v0.7.8
func (p5 *ProxyEngine) SetDebugLogger(l logger.Logger)
SetDebugLogger sets the debug logger for the ProxyEngine. See the Logger interface for implementation details.
Deprecated: use SetLogger instead. This will be removed in a future version.
func (*ProxyEngine) SetDialerBailout ¶ added in v0.7.8
func (p5 *ProxyEngine) SetDialerBailout(dialattempts int)
SetDialerBailout sets the amount of times the mysteryDialer will dial out and fail before it bails out.
- The dialer will attempt to redial a destination with a different proxy a specified amount of times before it gives up
func (*ProxyEngine) SetDispenseMiddleware ¶ added in v0.7.8
func (p5 *ProxyEngine) SetDispenseMiddleware(f func(*Proxy) (*Proxy, bool))
SetDispenseMiddleware will add a function that sits within the dialing process of the mysteryDialer and anyhing using it. This means this function will be called mid-dial during connections. Return true to approve proxy, false to skip it. Take care modiying the proxy in-flight as it is a pointer.
func (*ProxyEngine) SetLogger ¶ added in v0.9.5
func (p5 *ProxyEngine) SetLogger(l logger.Logger)
SetLogger sets the debug logger for the ProxyEngine. See the Logger interface for implementation details.
func (*ProxyEngine) SetMaxWorkers ¶ added in v0.7.8
func (p5 *ProxyEngine) SetMaxWorkers(num int)
SetMaxWorkers set the maximum workers for proxy checking.
func (*ProxyEngine) SetRemoveAfter ¶ added in v0.7.8
func (p5 *ProxyEngine) SetRemoveAfter(timesfailed int)
SetRemoveAfter sets the removeafter policy, the amount of times a recycled proxy is marked as bad before it is removed entirely.
- Default is 10
- To disable deleting entirely, set this value to -1
- Only applies when recycling is enabled
func (*ProxyEngine) SetServerTimeout ¶ added in v0.7.8
func (p5 *ProxyEngine) SetServerTimeout(timeout time.Duration)
SetServerTimeout sets the serverTimeout option. * serverTimeout defines the timeout for outgoing connections made with the mysteryDialer. * To disable timeout on outgoing mysteryDialer connections, set this to time.Duration(0).
func (*ProxyEngine) SetStaleTime ¶ added in v0.7.8
func (p5 *ProxyEngine) SetStaleTime(newtime time.Duration)
SetStaleTime replaces the duration of time after which a proxy will be considered "stale". stale proxies will be skipped upon retrieval.
func (*ProxyEngine) SetUserAgents ¶ added in v0.7.8
func (p5 *ProxyEngine) SetUserAgents(uagents []string)
SetUserAgents sets the list of useragents we randomly choose from during proxied requests
func (*ProxyEngine) SetValidationTimeout ¶ added in v0.7.8
func (p5 *ProxyEngine) SetValidationTimeout(timeout time.Duration)
SetValidationTimeout sets the validationTimeout option.
func (*ProxyEngine) Socks4Str ¶ added in v0.7.8
func (p5 *ProxyEngine) Socks4Str() string
Socks4Str gets a SOCKS4 proxy that we have fully verified. Will block if one is not available!
func (*ProxyEngine) Socks4aStr ¶ added in v0.7.8
func (p5 *ProxyEngine) Socks4aStr() string
Socks4aStr gets a SOCKS4 proxy that we have fully verified. Will block if one is not available!
func (*ProxyEngine) Socks5Str ¶ added in v0.7.8
func (p5 *ProxyEngine) Socks5Str() string
Socks5Str gets a SOCKS5 proxy that we have fully verified (dialed and then retrieved our IP address from a what-is-my-ip endpoint. Will block if one is not available!
func (*ProxyEngine) Start ¶ added in v0.7.8
func (p5 *ProxyEngine) Start() error
Start starts our proxy pool operations. Trying to start a running ProxyEngine will return an error.
func (*ProxyEngine) StartSOCKS5Server ¶ added in v0.7.8
func (p5 *ProxyEngine) StartSOCKS5Server(listen, username, password string) error
StartSOCKS5Server starts our rotating proxy SOCKS5 server. listen is standard Go listen string, e.g: "127.0.0.1:1080". username and password are used for authenticatig to the SOCKS5 server.
type ProxyProtocol ¶ added in v0.7.0
type ProxyProtocol int8
const ( // ProtoNull is a null value for ProxyProtocol. ProtoNull ProxyProtocol = iota ProtoSOCKS4 ProtoSOCKS4a ProtoSOCKS5 ProtoHTTP )
func (ProxyProtocol) String ¶ added in v0.7.0
func (p ProxyProtocol) String() string
type SocksLogger ¶ added in v0.7.0
type SocksLogger struct {
// contains filtered or unexported fields
}
func (SocksLogger) Printf ¶ added in v0.7.0
func (s SocksLogger) Printf(format string, a ...interface{})
Printf is used to handle socks server logging.
type Statistics ¶
type Statistics struct { // Valid4 is the amount of SOCKS4 proxies validated Valid4 *atomic.Int64 // Valid4a is the amount of SOCKS4a proxies validated Valid4a *atomic.Int64 // Valid5 is the amount of SOCKS5 proxies validated Valid5 *atomic.Int64 // ValidHTTP is the amount of HTTP proxies validated ValidHTTP *atomic.Int64 // Dispensed is a simple ticker to keep track of proxies dispensed via our getters Dispensed *atomic.Int64 // Stale is the amount of proxies that failed our stale policy upon dispensing Stale *atomic.Int64 // Checked is the amount of proxies we've checked. Checked *atomic.Int64 // contains filtered or unexported fields }
Statistics is used to encapsulate various proxy engine stats
func (*Statistics) GetUptime ¶
func (stats *Statistics) GetUptime() time.Duration
GetUptime returns the total lifetime duration of our pool.
type Swamp
deprecated
type Swamp struct {
*ProxyEngine
}
Swamp is a deprecated alias for ProxyEngine
Deprecated: use ProxyEngine instead.
func NewDefaultSwamp
deprecated
func NewDefaultSwamp() *Swamp
NewDefaultSwamp returns a new ProxyEngine instance.
Deprecated: use NewProxyEngine instead.