I have the following code but it always returns a 407 HTTP status code.
$url = 'http://whatismyip.org';
$client = new Client();
$options = array(
'proxy' => array(
'http' => 'tcp://@x.x.x.x:8010',
),
'auth' => array('d80fe9ebasab73d21a4', '', 'basic')
);
$crawler = $client->request('GET', $url, $options);
$status = $client->getResponse()->getStatus();
echo $status; // 407
I am using Goutte with Guzzle 6. I started off trying to set the proxy with setDefaultOption but this method has been deprecated.
My username and blank password is definitely correct as it works with curl on the command line:
curl -U d80fe9ebasab73d21a4: -vx x.x.x.x:8010 http://whatismyip.org/
I have spent several hours on this and I would appreciate any help!