Skip to content

Instantly share code, notes, and snippets.

@glagola
Created October 22, 2012 15:17
Show Gist options
  • Save glagola/3931984 to your computer and use it in GitHub Desktop.
Save glagola/3931984 to your computer and use it in GitHub Desktop.
file_get_contents proxy
<?php
$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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment