79778098

Date: 2025-09-29 12:43:14
Score: 1
Natty:
Report link

Nobody says it, but the commented example here shows that we should use tcp:// in the proxy protocol, while cURL accepts http... So this minimal script fixed the error:

$url = 'https://getcomposer.org/versions';
$opts = [
 'http' => [ 'proxy' => 'tcp://proxy.redecorp.br:8080' ]
];
$context = stream_context_create($opts);
echo file_get_contents($url,false,$context);
Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Peter Krauss