ProxiesConfig
Proxies config
Fields
Name | Type | Description |
---|---|---|
UseProxy | Bool | Required. Use proxies for requests |
SendOvertRequestsOnProxiesFailure | Bool | Required. Send a request from a host real IP address if all proxies failed |
IterateProxyResponseCodes | String | Optional. Comma-separated HTTP response codes to iterate proxies on. Default value is ‘401, 403’ |
Proxies | Array of ProxyConfig | Optional. Proxy configurations. Default value is an empty array |
Initialization String Format
An instance can be initialized with a string of the following format: UseProxy: true|false; SendOvertRequestsOnProxiesFailure: true|false; IterateProxyResponseCodes: 401, 403
Methods
Methods that help with initialization.
AddProxyConfig
Adds a new proxy configuration
Syntax
AddProxyConfig( proxyConfig )
SQLArguments
Name | Type | Description |
---|---|---|
proxyConfig | ProxyConfig | Required. Proxy configuration |
Return type
Return value
Returns the instance on which it was called
AddProxy
Adds a new proxy
Syntax
AddProxy( protocol, host, port, userName, password, connectionsLimit, availableHosts )
SQLArguments
Name | Type | Description |
---|---|---|
protocol | String | Required. Proxy protocol (http|https|socks5) |
host | String | Required. Proxy host |
port | Int | Required. Proxy port |
userName | String | Optional. Proxy username |
password | String | Optional. Proxy password |
connectionsLimit | Int | Optional. Proxy connections limit (how many connections can be established through this proxy at one time) |
availableHosts | String | Optional. A comma-separated list of available hosts that can be accessed through this proxy |
Return type
Return value
Returns the instance on which it was called
Examples
Creating a new instance initialized from a string:
DECLARE @proxiesConfig wds.ProxiesConfig = 'UseProxy: true; SendOvertRequestsOnProxiesFailure: true; IterateProxyResponseCodes: 401, 403';
SET @proxiesConfig = @proxiesConfig.AddProxy('https', 'example.com', 3128, null, null, null, null);
SET @proxiesConfig = @proxiesConfig.AddProxy('https', 'example.com', 3128, 'user', 'password', 10, 'host1.com, host2.com');
SQLCreating a new instance:
DECLARE @proxiesConfig wds.ProxiesConfig = 'UseProxy: true; SendOvertRequestsOnProxiesFailure: true; IterateProxyResponseCodes: 401, 403';
SET @proxiesConfig.UseProxy = 1;
SET @proxiesConfig = @proxiesConfig.AddProxy('https', 'example.com', 3128, null, null, null, null);
SQLProxyConfig
Proxy configuration
Fields
Name | Type | Description |
---|---|---|
Protocol | String | Required. Proxy protocol (http|https|socks5) |
Host | String | Required. Proxy host |
Port | Int | Required. Proxy port |
UserName | String | Optional. Proxy username |
Password | String | Optional. Proxy password |
ConnectionsLimit | Int | Optional. Proxy connections limit (how many connections can be established through this proxy at one time) |
AvailableHosts | Array of String | Optional. A list of available hosts that can be accessed through this proxy |
Initialization String Format
An instance can be initialized with a string of the following format: Protocol: protocol; Host: host; Port: port; UserName: userName; Password: password; ConnectionsLimit: connectionsLimit; AvailableHosts: availableHost1, availableHost2;
Methods
The ProxyConfig UTD has helper methods that make its initialization a little more convenient.
AddAvailableHost
Adds a new available host
Syntax
AddAvailableHost( host )
SQLArguments
Name | Type | Description |
---|---|---|
host | String | Required. Host |
Return type
Return value
Returns the instance on which it was called
Examples
Creating a new instance initialized from a string and adding in to a proxies connfig:
DECLARE @proxyConfig wds.ProxyConfig = 'Protocol: socks5; Host: example.com; Port: 1080';
SET @proxyConfig.ConnectionsLimit = 10;
SET @proxiesConfig = @proxiesConfig.AddProxyConfig(@proxyConfig);
SQLCreating a new instance initialized from a string and adding in to a proxies connfig:
DECLARE @proxyConfig wds.ProxyConfig = 'Protocol: socks5; Host: example.com; Port: 1080; UserName: userName; Password: password; ConnectionsLimit: 10; AvailableHosts: host1.com, host2.com;';
SET @proxyConfig = @proxyConfig.AddAvailableHost('host3.com');
SET @proxiesConfig = @proxiesConfig.AddProxyConfig(@proxyConfig);
SQL