Set the proxy to use for making requests.
Access
public
Parameters
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
|
Required |
The faux-url to use for proxy settings. Takes the following format: |
Returns
Type |
Description |
|---|---|
|
A reference to the current instance. |
Examples
Pass in a proxy DSN string, and process it with prep_request() (without firing the request).
$http = new RequestCore('http://github.com/skyzyx/requestcore/raw/master/_tests/test_request.txt');
$http->set_proxy('proxy://user:pass@hostname:80');
$http->prep_request();
var_dump($http->proxy);
Result:
array(5) {
["scheme"]=>
string(5) "proxy"
["host"]=>
string(8) "hostname"
["port"]=>
int(80)
["user"]=>
string(4) "user"
["pass"]=>
string(4) "pass"
}
Source
Method defined in lib/requestcore/requestcore.class.php | Toggle source view (9 lines) | View on GitHub

