For an ordinary HTTP request without PHP cURL, pass a proxy context to the HTTP stream wrapper:

$context = stream_context_create([
    'http' => [
        'proxy' => 'tcp://203.0.113.10:8080',
        'request_fulluri' => true,
        'timeout' => 10,
    ],
]);
$body = file_get_contents('http://example.com/', false, $context);

Replace the documentation endpoint with your HTTP proxy or a candidate from the HTTP proxy list. The HTTP context interface expects a TCP address for proxy. request_fulluri=true puts the complete destination URI in the request line, as many forward proxies require. The timeout bounds the stream operation under that wrapper's rules.

Check the returned value and warning before parsing the body; a failed read and an empty successful response require different handling. Start diagnosis with this one HTTP destination and bounded request. HTTPS adds tunneling and TLS behavior that must be checked for the actual wrapper/PHP version; this example does not establish those capabilities.

Passing the context at this call keeps the route visible and avoids changing unrelated URL reads. A shared default context is appropriate only when the application deliberately wants that policy; libraries should account for its wider scope.

This configures PHP streams, not an independently created cURL handle, a browser or another process. Identify a package's actual HTTP transport before expecting it to use this context.

Mikanda mikatakata