Add Proxy Context Stream For PHP
Join the DZone community and get the full member experience.Join For Free
// description of your code here
$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);
PHP Stream (computing)
Opinions expressed by DZone contributors are their own.