Class ProxyPool
Class that manages a pool of proxies.
Inheritance
Inherited Members
Namespace: RuriLib.Models
Assembly: RuriLib.dll
Syntax
public class ProxyPool
Constructors
| Improve this Doc View SourceProxyPool(IEnumerable<String>, ProxyType)
Initializes the proxy pool given a collection of string to be parsed as proxies and their type.
Declaration
public ProxyPool(IEnumerable<string> proxies, ProxyType type)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<System.String> | proxies | The collection of strings to parse the proxies from |
Extreme.Net.ProxyType | type | The type of the proxies |
ProxyPool(List<CProxy>)
Initializes the proxy pool given a collection of CProxy objects.
The proxies will be first cloned and then stored in the list.
They will also be unbanned to make sure there are no leftovers from previous checks.
Declaration
public ProxyPool(List<CProxy> proxies)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<CProxy> | proxies | The list of CProxy objects to be cloned and added to the list |
Properties
| Improve this Doc View SourceAlive
The list of Alive proxies (AVAILABLE or BUSY).
Declaration
public List<CProxy> Alive { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<CProxy> |
Available
The list of Available proxies.
Declaration
public List<CProxy> Available { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<CProxy> |
Bad
The list of Bad proxies.
Declaration
public List<CProxy> Bad { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<CProxy> |
Banned
The list of Banned proxies.
Declaration
public List<CProxy> Banned { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<CProxy> |
Proxies
The full list of proxies in the pool.
Declaration
public List<CProxy> Proxies { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<CProxy> |
Methods
| Improve this Doc View SourceClearCF()
Clears the Clearance and Cfduid cookies set by Cloudflare.
Declaration
public void ClearCF()
GetProxy(Boolean, Int32, Boolean)
Tries to return the first available proxy from the list.
Declaration
public CProxy GetProxy(bool evenBusy, int maxUses, bool neverBan = false)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | evenBusy | Whether to include proxies that are being used by other bots |
System.Int32 | maxUses | The maximum uses of a proxy, after which it will be banned (0 for infinite) |
System.Boolean | neverBan | Whether a proxy can ever be banned |
Returns
Type | Description |
---|---|
CProxy | The first available proxy respecting the conditions or null |
UnbanAll()
Sets all the BANNED and BAD proxies status to AVAILABLE and resets their Uses. It also clears the Cloudflare cookies.
Declaration
public void UnbanAll()