ProxyModel class

Data model for a proxy server

Inheritance

Constructors

ProxyModel({required String ip, required int port, String? countryCode, bool isHttps = false, ProxyProtocol protocol = ProxyProtocol.http, String? anonymityLevel, String? region, String? isp, double? speed, bool? supportsWebsockets, ProxyAuth? auth, int? lastChecked, int? responseTime, ProxyScore? score, String? username, String? password})
Creates a new ProxyModel instance
ProxyModel.fromEntity(Proxy proxy)
Creates a ProxyModel from a Proxy entity
factory
ProxyModel.fromJson(Map<String, dynamic> json)
Creates a ProxyModel from a JSON map
factory

Properties

anonymityLevel → String?
Anonymity level of the proxy (e.g., 'elite', 'anonymous', 'transparent')
finalinherited
auth → ProxyAuth?
Authentication credentials (optional)
finalinherited
authMethod → ProxyAuthMethod
Returns the authentication method
no setterinherited
country → String?
Country name of the proxy server (optional)
finalinherited
countryCode → String?
Country code of the proxy server (optional)
finalinherited
hashCode → int
The hash code for this object.
no setterinherited
host → String
Returns the host (IP address) of the proxy
no setterinherited
ip → String
IP address of the proxy server
finalinherited
isAuthenticated → bool
Returns true if this proxy requires authentication
no setterinherited
isHttps → bool
Whether the proxy supports HTTPS @deprecated Use protocol instead
finalinherited
isp → String?
Internet Service Provider of the proxy (optional)
finalinherited
lastChecked → int?
Last time the proxy was checked (in milliseconds since epoch)
final
latency → int?
Latency of the proxy in milliseconds (optional)
finalinherited
password → String?
Password for authenticated proxies (optional) @deprecated Use auth instead
no setterinherited
port → int
Port number of the proxy server
finalinherited
protocol → ProxyProtocol
Protocol used by the proxy
finalinherited
region → String?
Region or city of the proxy server (optional)
finalinherited
responseTime → int?
Response time of the proxy in milliseconds (optional)
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
score → ProxyScore?
Performance and reliability score for this proxy
finalinherited
socksVersion → int?
SOCKS version if applicable (optional) @deprecated Use protocol instead
no setterinherited
speed → double?
Maximum speed of the proxy in Mbps (optional)
finalinherited
supportsSocks → bool?
Whether the proxy supports SOCKS protocol (optional) @deprecated Use protocol instead
no setterinherited
supportsWebsockets → bool?
Whether the proxy supports websockets (optional)
finalinherited
url → String
Returns the proxy URL in the format 'http(s)://ip:port'
no setterinherited
username → String?
Username for authenticated proxies (optional) @deprecated Use auth instead
no setterinherited

Methods

copyWith({String? ip, int? port, String? countryCode, bool? isHttps, String? anonymityLevel, String? region, String? isp, double? speed, bool? supportsWebsockets, ProxyProtocol? protocol, ProxyAuth? auth, int? lastChecked, int? responseTime, ProxyScore? score}) → ProxyModel
Creates a copy of this ProxyModel with the given parameters
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Converts this ProxyModel to a JSON map
toString() → String
Returns a string representation of the proxy in the format 'ip:port'
inherited
withAuth(ProxyAuth auth) → ProxyModel
Creates a new ProxyModel with the given authentication credentials
override
withBasicAuth(String username, String password) → ProxyModel
Creates a new ProxyModel with basic authentication
override
withDigestAuth(String username, String password) → ProxyModel
Creates a new ProxyModel with digest authentication
withFailedRequest() → ProxyModel
Creates a new ProxyModel with an updated score after a failed request
withNtlmAuth(String username, String password, String domain) → ProxyModel
Creates a new ProxyModel with NTLM authentication
withSuccessfulRequest(int responseTime) → ProxyModel
Creates a new ProxyModel with an updated score after a successful request

Operators

operator ==(Object other) → bool
The equality operator.
inherited