Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Add Proxy Context Stream For PHP

DZone's Guide to

Add Proxy Context Stream For PHP

·
Free Resource
// 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);

Topics:

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}