How to use file_get_contents with a proxy
$url = 'http://www';
$proxy = 'tcp://xxx:8080';
$context = array(
'http' => array(
'proxy' => $proxy,
'request_fulluri' => True,
),
);
$context = stream_context_create($context);
$body = file_get_contents($url, False, $context);
The code was found here. Note that it doesn't seem to work with HTTPS.